trying to upgrade the jmh plugin, with gradle 5.6 the kotlin gradle plugin warns about the deprecati...
e
trying to upgrade the jmh plugin, with gradle 5.6 the kotlin gradle plugin warns about the deprecation of the
DefaultSourceDirectorySet
constructor:
The DefaultSourceDirectorySet constructor has been deprecated. This is scheduled to be removed in Gradle 6.0. Please use the ObjectFactory service to create instances of SourceDirectorySet instead.
with gradle 6.0 the plugin crashes because the method does not exist anymore (it calls it via reflection):
Copy code
Caused by: java.lang.NoSuchMethodException: org.gradle.api.internal.file.DefaultSourceDirectorySet.<init>(java.lang.String, org.gradle.api.internal.file.FileResolver, org.gradle.api.internal.file.collections.DirectoryFileTreeFactory)
	at java.base/java.lang.Class.getConstructor0(Class.java:3349)
	at java.base/java.lang.Class.getConstructor(Class.java:2151)
	at org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt.<clinit>(DefaultKotlinSourceSet.kt:148)
	... 191 more
Old code is here: https://github.com/JetBrains/kotlin/blob/a44d70e79d06a5133b86470c749cc2d0bf870053/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultKotlinSourceSet.kt#L149 however in the actual code, that snippet has been reworked: https://github.com/JetBrains/kotlin/blob/bd66e87440b9d2463437a4682128d4ce24de91ca/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultKotlinSourceSet.kt#L226-L227 I do use
1.3.72
, a
dependencies
task prints out:
Copy code
kotlinCompilerPluginClasspath
+...
\--- org.jetbrains.kotlin:kotlin-sam-with-receiver:1.3.72
     +--- org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.3.72
     |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
     |    \--- org.jetbrains.kotlin:kotlin-native-utils:1.3.72
     |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
     |         \--- org.jetbrains.kotlin:kotlin-util-io:1.3.72
     |              \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
     +--- org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.3.72
     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
     \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
but I don't know when that snippet has been actually implemented.. I cant seem to find 1.3.72 on the repo, although 1.3.70 does have still the deprecated constructor: https://github.com/JetBrains/kotlin/blob/1.3.70/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultKotlinSourceSet.kt#L249
g
What is context of this issue? 1.3.7x is definitely compatible with Gradle 6.0
maybe you have 2 plugins in build classpath? Maybe you have one applied in buildscript classpath and one in plugins dsl?
e
an updated jmh-gradle-plugin
let me push
then change gradle (from 5.6) to 6.0, then run it again and you'll get the crash
g
So it’s an issue with jmh plugin?
It probably fails because it depends (in tests) on an old version of Kotlin plugin which doesn’t support Gradle 6.0
e
it's an issue when the
KotlinBasePluginWrapper::apply
gets called
see, it used for functional tests
e
let me update that as well as try again
I was paying attention only to the functionalTest configuration dependencies, which were
1.3.72
I don't get the warning anymore with 5.6
g
functionalTest configuration dependencies
Those used to build functional tests, one above is used as dependency of test itself, essentially plugin tested against this verision
e
yep, no more crashes
thanks for the precious input, Andrey
🙏 1