Slackbot
08/01/2022, 7:21 AMMartin
08/01/2022, 8:48 AMMartin
08/01/2022, 8:48 AMMartin
08/01/2022, 8:51 AMNoClassDefFoundError
Eli Graber
08/01/2022, 8:52 AMEli Graber
08/01/2022, 10:57 AMNoClassDefFoundError
seemingly caused by a nested lambda that is referenced in bytecode but is not getting compiled to a class file.
If you run:
cd plugin
./gradlew publishToMavenLocal
cd ../app
./gradlew tasks
then you should see the failure:
* What went wrong:
Com_eygraber_publish_gradle$2$1$1
> Com_eygraber_publish_gradle$2$1$1
To get it to work, edit plugin/src/main/kotlin/com.eygraber-publish.gradle.kts
line 24 from:
repositories {
githubPackagesPublishing(
owner = "eygraber",
repo = repoName
)
}
to
repositories.githubPackagesPublishing(
owner = "eygraber",
repo = repoName
)
then run the steps above again and the task will complete successfully.Martin
08/01/2022, 11:31 AMcompiler-issue-plugin-0.0.1.jar
, you will not find a matching .class file for Com_eygraber_publish_gradle$2$1$1
Martin
08/01/2022, 11:41 AMplugins {
`embedded-kotlin`
id("org.jetbrains.kotlin.plugin.sam.with.receiver")
id("java-gradle-plugin")
alias(libs.plugins.publish)
}
samWithReceiver {
annotation("org.gradle.api.HasImplicitReceiver")
}
gradlePlugin {
plugins {
create("com.eygraber-publish") {
id = "com.eygraber-publish"
implementationClass = "MyPlugin"
}
}
}
Martin
08/01/2022, 11:43 AMkotlin-dsl
plugin does a bunch of things to support precompiled script plugins. I'd suspect something is lost there or there is some unfortunate interaction with the Kotlin compilerMartin
08/01/2022, 11:45 AMEli Graber
08/01/2022, 12:39 PMremove the precompiled script plugin support
I have a feeling that will fix it as well, however I found a workaround that's much less involved (see the end of my previous message) I'm going to file an issue for it, but I thought I'd put it here first in case anyone was already aware of the problem
By using "regular" (i.e. not precompiled) Kotlin plugins, you'll also save some time
These plugins are in a different project and are compiled into a separate artifact, precisely to solve the issue you linked 😁
Martin
08/01/2022, 12:52 PMEli Graber
08/01/2022, 7:10 PMVampire
08/01/2022, 8:34 PM