Justin Tullgren
09/18/2023, 7:25 PMpluginManager.withPlugin("org.jetbrains.kotlin.jvm")
and trying to configure the the KotlinCompile
task tasks.withType<KotlinCompile>().configureEach
. however, gradle says the class can’t be found. This is a JVM project. Any idea why?mbonnin
09/18/2023, 7:30 PMmbonnin
09/18/2023, 7:30 PMKotlinCompile
classes in your classpath but it's hard to tell. Maybe double check you have KGP as a compileOnly
dependency of your plugin?Justin Tullgren
09/18/2023, 7:31 PMJustin Tullgren
09/18/2023, 7:31 PMJustin Tullgren
09/18/2023, 7:32 PMJustin Tullgren
09/18/2023, 7:34 PMCaused by: java.lang.IllegalArgumentException: No enum constant org.jetbrains.kotlin.statistics.metrics.StringMetrics.USE_CLASSPATH_SNAPSHOT
mbonnin
09/18/2023, 7:35 PMJustin Tullgren
09/18/2023, 7:36 PMJustin Tullgren
09/18/2023, 7:36 PMmbonnin
09/18/2023, 7:36 PMlibs.kotlinGradlePlugin
and the plugin alias you have for KGP point to the same versionJustin Tullgren
09/18/2023, 7:36 PMJustin Tullgren
09/18/2023, 7:36 PMmbonnin
09/18/2023, 7:39 PMNoClassDefFoundError
and ClassNotFoundexception
are different. I'm assuming you got ``ClassNotFoundexception`` in debug, right?mbonnin
09/18/2023, 7:40 PMClassNotFoundexception
and after that, it "remembers" and throws NoClassDefFoundError
Justin Tullgren
09/18/2023, 7:40 PMNoClassDefFoundError
Justin Tullgren
09/18/2023, 7:41 PMJustin Tullgren
09/18/2023, 7:41 PMmbonnin
09/18/2023, 7:41 PM./gradlew stop && ./gradlew build
?Justin Tullgren
09/18/2023, 7:41 PMJustin Tullgren
09/18/2023, 7:43 PMstop
task in the projectmbonnin
09/18/2023, 7:43 PM./gradlew --stop
Justin Tullgren
09/18/2023, 7:44 PMmbonnin
09/18/2023, 7:44 PMJustin Tullgren
09/18/2023, 7:45 PMmbonnin
09/18/2023, 7:46 PMorg.jetbrains.kotlin.statistics.metrics.StringMetrics.USE_CLASSPATH_SNAPSHOT
would be interesting.
Something else you can try is ./gradlew buildEnvironment
in your project where KGP and your convention plugin are applied and see if any odd version of KGP is thereJustin Tullgren
09/18/2023, 7:49 PMJustin Tullgren
09/18/2023, 7:51 PM./gradlew buildEnvironment
fails before the reportmbonnin
09/18/2023, 7:52 PMmbonnin
09/18/2023, 7:53 PMmbonnin
09/18/2023, 7:54 PMJustin Tullgren
09/18/2023, 7:55 PMmbonnin
09/18/2023, 7:57 PMmbonnin
09/18/2023, 7:58 PMJustin Tullgren
09/18/2023, 7:59 PMPlugin<Settings>
in my settings.gradle.kts and that let it pass…. i was just applying common dependency reposJustin Tullgren
09/18/2023, 7:59 PMJustin Tullgren
09/18/2023, 7:59 PMsolonovamax
09/20/2023, 9:48 PMtasks.withType<KotlinCompile>().configureEach { }
then so long as KotlinCompile
is on the classpath, it should work (it will apply the configuration to tasks added afterwards)