ge-org / multiplatform-swiftpackage

Gradle plugin that generates a Swift Package Manager manifest and an XCFramework to distribute a Kotlin Multiplatform library for Apple platforms.
Apache License 2.0
336 stars 49 forks source link

Add support for Groovy DSL #18

Closed ge-org closed 3 years ago

ge-org commented 3 years ago

The plugin DSL was not compatible with Groovy because (1) nested lambdas were executed in the wrong receiver scope and because (2) Groovy functions do not support vararg and trailing closure at the same time.

To resolve the first issue uses of the Action<> interface were replaced with closures with receiver instead. Also, an overload for each public function that accepts a closure as an argument was added, where instead of the lambda the Groovy Closure<> type is used.

The second issue is fixed by adding an overload that accepts a list instead of a vararg.