Jacob Skillin
01/20/2025, 4:03 PMfailOnVersionConflict resolution strategy, and dependency locking lockAllConfigurations turned on, ends up requiring also the exact same version of Gradle to reproduce the same build. This appears to be because the kotlin-dsl plugin aggressively writes the stdlib and other dependencies into the graph:
* What went wrong:
Execution failed for task ':dependencies'.
> Could not resolve all dependencies for configuration ':compileClasspath'.
> Conflicts found for the following modules:
- org.jetbrains.kotlin:kotlin-stdlib between versions 1.9.24 and 1.9.22
- org.jetbrains.kotlin:kotlin-reflect between versions 1.9.24 and 1.9.22
In order to correctly reproduce a Gradle build that uses Kotlin, is it also required that I use the exact same version of Gradle to invoke the exact same Kotlin compiler as well? Or is it possible to ask Kotlin to use different dependencies in my project?Adam
01/20/2025, 7:28 PMJacob Skillin
01/20/2025, 9:42 PMplugins {
`kotlin-dsl`
`java-gradle-plugin`
}Jacob Skillin
01/20/2025, 10:00 PMplugins {
`kotlin-dsl`
}Jacob Skillin
01/20/2025, 10:39 PMplugins {
`java-gradle-plugin`
kotlin("jvm") version "1.9.22"
}Jacob Skillin
01/20/2025, 11:06 PMkotlin-dsl does quite a bit of work I'd be missing. So it appears this plugin is not supported in combination with a the reproducible build features?Adam
01/21/2025, 4:51 PMkotlin-dsl plugin then I would expect that it should work. I guessed you were applying conflicting plugins.Adam
01/21/2025, 4:51 PMfailOnVersionConflict, but it is usefulJacob Skillin
01/21/2025, 5:10 PMcoreLibrariesVersion and other flags, I can stop the stdlib version from shifting around.Jacob Skillin
01/22/2025, 10:21 PMkotlin-dsl plugin does most of the work needed to make Kotlin a drop-in replacement for the Groovy syntax, and it is extremely rigid about versions:
https://github.com/gradle/gradle/blob/master/platforms/core-configuration/kotlin-d[…]otlin/org/gradle/kotlin/dsl/plugins/base/KotlinDslBasePlugin.ktJacob Skillin
01/22/2025, 11:47 PM