Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Groovy DSL #18

Merged
merged 1 commit into from
Jan 11, 2021
Merged

Add support for Groovy DSL #18

merged 1 commit into from
Jan 11, 2021

Conversation

ge-org
Copy link
Owner

@ge-org ge-org commented Jan 7, 2021

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.

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.
@ge-org ge-org added this to the 2.0.3 milestone Jan 7, 2021
@ge-org ge-org linked an issue Jan 7, 2021 that may be closed by this pull request
@ge-org ge-org merged commit 14c86bd into next-release Jan 11, 2021
@ge-org ge-org deleted the fix/groovy branch January 11, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot Be Used With Groovy DSL
1 participant