-
Notifications
You must be signed in to change notification settings - Fork 360
[gradle plugin] GraphQL extension cannot be used from Groovy scripts #893
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
Labels
type: bug
Something isn't working
Comments
When working on this issue we should also update our documentation with samples for both Kotlin and Groovy based build files. |
dariuszkuc
added a commit
to dariuszkuc/graphql-kotlin
that referenced
this issue
Oct 9, 2020
Originally extension was using Kotlin lambdas for some configuration which worked fine when used from Kotlin script (`build.gralde.kts`) but it could not be easily used from Groovy scripts (`build.gradle`). By changing from lambda with a receiver to a Groovy Action the resulting code will be translated using SAM conversion that makes it possible to configure the extension using Kotlin lambda or Groovy closure. Resolves: ExpediaGroup#893
dariuszkuc
added a commit
to dariuszkuc/graphql-kotlin
that referenced
this issue
Oct 9, 2020
Originally extension was using Kotlin lambdas for some configuration which worked fine when used from Kotlin script (`build.gralde.kts`) but it could not be easily used from Groovy scripts (`build.gradle`). By changing from lambda with a receiver to a Groovy Action the resulting code will be translated using SAM conversion that makes it possible to configure the extension using Kotlin lambda or Groovy closure. Resolves: ExpediaGroup#893
smyrick
pushed a commit
that referenced
this issue
Oct 11, 2020
* [plugin] update Gradle plugin extension to use Actions Originally extension was using Kotlin lambdas for some configuration which worked fine when used from Kotlin script (`build.gralde.kts`) but it could not be easily used from Groovy scripts (`build.gradle`). By changing from lambda with a receiver to a Groovy Action the resulting code will be translated using SAM conversion that makes it possible to configure the extension using Kotlin lambda or Groovy closure. Resolves: #893 * fix ktlint violations
huehnerlady
pushed a commit
to huehnerlady/graphql-kotlin
that referenced
this issue
Oct 16, 2020
) * [plugin] update Gradle plugin extension to use Actions Originally extension was using Kotlin lambdas for some configuration which worked fine when used from Kotlin script (`build.gralde.kts`) but it could not be easily used from Groovy scripts (`build.gradle`). By changing from lambda with a receiver to a Groovy Action the resulting code will be translated using SAM conversion that makes it possible to configure the extension using Kotlin lambda or Groovy closure. Resolves: ExpediaGroup#893 * fix ktlint violations
dariuszkuc
added a commit
to dariuszkuc/graphql-kotlin
that referenced
this issue
Aug 5, 2022
) * [plugin] update Gradle plugin extension to use Actions Originally extension was using Kotlin lambdas for some configuration which worked fine when used from Kotlin script (`build.gralde.kts`) but it could not be easily used from Groovy scripts (`build.gradle`). By changing from lambda with a receiver to a Groovy Action the resulting code will be translated using SAM conversion that makes it possible to configure the extension using Kotlin lambda or Groovy closure. Resolves: ExpediaGroup#893 * fix ktlint violations
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Library Version
4.0.0-alpha.4
Describe the bug
GraphQLPluginExtension is using Kotlin lambdas for configuration which makes it unusable from Groovy build files. We should use Gradle
Action
instead of lambdas - i.e. instead ofGraphQLPluginClientExtension.() -> Unit
useAction<GraphQLPluginClientExtension>
To Reproduce
Apply
graphql
extension inbuild.gradle
Expected behavior
GraphQL extension DSL can be used from both Groovy and Kotlin scripts.
Workaround
Instead of extension we can configure tasks explicitly
The text was updated successfully, but these errors were encountered: