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

Non-Kotlin extensions crash the build when using Kotlin DSL + Kotlin plugins #10729

Closed
octylFractal opened this issue Sep 16, 2019 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@octylFractal
Copy link
Member

Expected Behavior

I should be able to use extensions written in languages other than Kotlin.

Current Behavior

The build crashes with this message:

* What went wrong:
Unresolved class: class edu.wpi.first.gradlerio.frc.FRCPlugin$_apply_closure8

Context

This stopped working in Gradle 5.6, due to this being added. It assumes that concreteClass is a Kotlin type, and converts it to a KClass, but when the visibility is resolved, it obviously cannot find the Kotlin metadata and throws the above error. It should probably detect if it is indeed a Kotlin type, and otherwise detect via normal Java mechanisms.

Note: it's not quite as simple as simply adding a non-Kotlin plugin, and I'm not exactly sure why. It seems like the accessor class path isn't attempted for generation unless I apply it as a dependency of my Kotlin-DSL-based plugin. Regardless, the following project reliably reproduces the issue.

Steps to Reproduce

Run the build for this project:
https://github.com/kenzierocks/gradle-kdsl-gen-accessors-non-kotlin-types-issue

Your Environment

Build scan URL: https://scans.gradle.com/s/5cm4zyadrsscs

@eskatos
Copy link
Member

eskatos commented Sep 16, 2019

Thanks for the report @kenzierocks, I can confirm the regression.

The ProjectSchemaProvider chokes on Groovy closures added as extensions, like in:

https://github.com/wpilibsuite/GradleRIO/blob/304f416e374874fd73b994999aa9fab6cbf7e4a0/src/main/groovy/edu/wpi/first/gradlerio/frc/FRCPlugin.groovy#L76-L78

@eskatos
Copy link
Member

eskatos commented Oct 12, 2019

Fixed in 6516f3a for Gradle 5.6.3 and in aa0d471973449263c4219e10dffd4ca0b08a28fdfor for Gradle 6.0

Thanks again for the report @kenzierocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants