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

Let Kotlin DSL gracefully handle lambdas registered as extensions #10758

Merged
merged 1 commit into from Sep 18, 2019

Conversation

eskatos
Copy link
Member

@eskatos eskatos commented Sep 17, 2019

Local Groovy Closure, local Kotlin lambda, local Java lambda, all makes the Kotlin DSL fails throwing an exception starting with Gradle 5.6. This is due to changes in kotlin-reflect 1.3.41 that is now more correct and refuse to answer queries it can't complete.

This PR lets the ProjectSchemaProvider skip local, anonymous and synthetic classes when finding the nearest public type visible to Kotlin when gathering the schema elements.

This plugin got broken with the Kotlin DSL in Gradle 5.6 and triggered this work. It registers a local Groovy Closure as an extension: https://github.com/wpilibsuite/GradleRIO/blob/304f416e374874fd73b994999aa9fab6cbf7e4a0/src/main/groovy/edu/wpi/first/gradlerio/frc/FRCPlugin.groovy#L76-L78

@eskatos eskatos force-pushed the eskatos/kotlin-dsl/project-schema-lambda-extensions branch from ba47fef to fc6ecc5 Compare September 17, 2019 18:44
@eskatos eskatos changed the base branch from release to master September 18, 2019 08:42
@eskatos eskatos marked this pull request as ready for review September 18, 2019 08:42
@eskatos eskatos force-pushed the eskatos/kotlin-dsl/project-schema-lambda-extensions branch from fc6ecc5 to f9e4f29 Compare September 18, 2019 13:39
and coverage for lost type info with typed Java and Kotlin lambdas

Signed-off-by: Paul Merlin <paul@gradle.com>
@eskatos eskatos force-pushed the eskatos/kotlin-dsl/project-schema-lambda-extensions branch from f9e4f29 to 02d6863 Compare September 18, 2019 13:48
@eskatos eskatos merged commit aa0d471 into master Sep 18, 2019
@eskatos eskatos deleted the eskatos/kotlin-dsl/project-schema-lambda-extensions branch September 18, 2019 15:41
@eskatos eskatos added this to the 6.0 RC1 milestone Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants