Shannon Lloyd
08/20/2020, 9:48 PMkotlin-dsl
in buildSrc bundles its own version of Kotlin (which I believe is currently 1.3.72), it is currently impossible to upgrade a Gradle kotlin project to 1.4.0 if we are also authoring plugins using kotlin-dsl
in buildSrc? We're seeing classpath issues (e.g. NoSuchMethodErrors) relating to still having 1.3.72 on the classpath after upgrading everything to 1.4.0 (we end up with both versions on the classpath). Are we basically stuck on 1.3.72 until Gradle releases a version with a bundled Kotlin 1.4.x?octylFractal
08/20/2020, 9:50 PMpniederw
08/26/2020, 2:00 AMoctylFractal
08/26/2020, 2:01 AMbuildSrc
is on 1.3.72 can be.... difficult, if I recall correctlypniederw
08/26/2020, 2:02 AMbuildSrc
uses whatever is bundled with Gradle, which as of 6.6 is 1.3.72. And you are saying it might be difficult to build my application code with 1.4?octylFractal
08/26/2020, 2:04 AMbuildSrc
, it's no issue, otherwise you normally would want the 1.4 plugin and I think but could be wrong that it causes issues. Maybe that's a thing of the pastpniederw
08/26/2020, 2:05 AMoctylFractal
08/26/2020, 2:06 AMpniederw
08/26/2020, 2:07 AMoctylFractal
08/26/2020, 2:07 AMimplementation(kotlin("stdlib-jdk8"))
and it defaults to the plugin's versionpniederw
08/26/2020, 2:08 AMShannon Lloyd
08/26/2020, 2:09 AMkotlin-dsl
is still pulling in 1.3.72 (until a new Gradle release upgrades it to 1.4.0), and even if I have explicitly specified 1.4.0 in my project, 1.3.72 remains on the build classpath, and the two versions conflict with each other during the build, resulting in things like NoSuchMethodErrors.pniederw
08/26/2020, 2:10 AMoctylFractal
08/26/2020, 2:10 AMbuildSrc
is actually added to the main build 🙂pniederw
08/26/2020, 2:11 AMoctylFractal
08/26/2020, 2:11 AMpniederw
08/26/2020, 2:11 AMShannon Lloyd
08/26/2020, 2:11 AMoctylFractal
08/26/2020, 2:11 AMbuild.gradle(.kts)
classpath is yet another entrypniederw
08/26/2020, 2:13 AMShannon Lloyd
08/26/2020, 2:13 AMkotlin-dsl
.pniederw
08/26/2020, 2:15 AMimplementation
configuration of buildSrc/build.gradle.kts
, which probably means you can only use the same (1.3.72) plugin version in your main build scriptsoctylFractal
08/26/2020, 2:21 AMcompileOnly(kotlin("gradle-plugin"))
in buildSrc
😛runtimeOnly
entry)Shannon Lloyd
08/26/2020, 2:22 AMpniederw
08/26/2020, 2:23 AMoctylFractal
08/26/2020, 2:23 AMShannon Lloyd
08/26/2020, 2:25 AMpniederw
08/26/2020, 2:26 AMoctylFractal
08/26/2020, 2:27 AMbuildSrc
is effectively a plugin operating in gradle-space, so it has to compile against gradle's internal kotlin 1.3.72, just like gradle plugins have to compile against java 8 for widespread use.buildSrc
just finepniederw
08/26/2020, 2:29 AMbuildSrc/src/main/kotlin/kotlin-conventions.gradle.kts
, I want to apply the 1.4 plugin.kotlin-conventions
octylFractal
08/26/2020, 2:30 AMpniederw
08/26/2020, 2:30 AMcompileOnly
trick.octylFractal
08/26/2020, 2:33 AMruntimeClasspath
isn't documented, but it also feels a little expected to me if you consider that `buildSrc`'s compiled code is added to the classpath, so must the runtime classpathpniederw
08/26/2020, 2:40 AMjannis
09/02/2020, 10:09 AMcompileOnly
trick doesn’t seem to work for me. I think because I actually use the Gradle Plugin, since I have a custom Plugin in the buildSrc
Folder.NoSuchMethodErrors
when using kapt
pniederw
09/02/2020, 5:13 PM