bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
530 stars 305 forks source link

Gradle Project fails to configure with Kotlin >= 1.7.0 #6264

Closed maxemann96 closed 2 weeks ago

maxemann96 commented 3 weeks ago

Error description

Kotlin compile tasks no longer inherit the Gradle AbstractCompile task. They inherit only the DefaultTask (Directly taken from the release changelog from 1.7.0).

Error appearance

The error appears in the gradle configuration phase (so for any gradle subcommand):

A problem occurred configuring project ':my_awesome_project'.
> The task 'compileKotlin' (org.jetbrains.kotlin.gradle.tasks.KotlinCompile) is not a subclass of the given type (org.gradle.api.tasks.compile.AbstractCompile).

Where to find the erroneous code

See Line 321ff BndPlugin.java.

Known workaround

Sadly not

pkriens commented 2 weeks ago

@bjhargrave any idea?

bjhargrave commented 2 weeks ago

That looks like a lot of work on our part We just assume all compile tasks are AbstractCompileTask and use methods defined on AbstractCompileTask. We would have to write special code using reflection to configure Kotlin compile tasks. Nice job Kotlin...

pkriens commented 1 week ago

thx. I remember that the Kotlin architecture also seemed designed to not let bnd use it :-( They would not create the byte codes on the fly.

pkriens commented 1 week ago

@maxemann96 I seem to have closed accidentally is as not planned but you're of course free to submit a PR or raise an issue with Kotlin.