Slackbot
01/28/2024, 4:48 PMMartin
01/28/2024, 4:53 PM-Dorg.gradle.kotlin.dsl.scriptCompilationAvoidance=false
workarounds it. There's an issue open there: https://github.com/gradle/gradle/issues/25412Vampire
01/28/2024, 4:53 PMVampire
01/28/2024, 4:55 PMMartin
01/28/2024, 4:56 PMVampire
01/28/2024, 5:23 PMVampire
01/28/2024, 5:29 PMVampire
01/28/2024, 5:36 PMVampire
01/28/2024, 5:43 PMVampire
01/28/2024, 6:06 PMwithPluginClasspath
vs. using a deployed version from a repository?
I'd like to understand what the difference is to maybe see another work-around before changing the infrastructure completely.Martin
01/28/2024, 6:08 PMVampire
01/28/2024, 6:51 PMVampire
01/28/2024, 9:08 PMinternal
for now.
It would be nice to have them downstream, but it's not particularly necessary.Vampire
01/28/2024, 9:09 PMVampire
01/28/2024, 10:04 PMpluginClasspath
on the GradleRunner
to remove the classes output directories and instead put in the jar file with the code, the testee build script cannot find the classes.
If I filter the pluginClasspath
to just remove the classes output directories and add the jar file with the code using buildscript { dependencies { classpath(files("$codeJar")) } }
the test works fine with the public inline functions.
So while the public inline functions seem to only be a problem in individual class files but not within a jar, putting the jar onto the pluginClasspath
seems to not work. šVampire
01/28/2024, 10:07 PMpluginClasspath
and via buildscript
block.
This is really strange.Martin
01/28/2024, 10:21 PMMartin
01/28/2024, 10:22 PMMartin
01/28/2024, 10:22 PMMartin
01/28/2024, 10:22 PMVampire
01/28/2024, 10:22 PMpluginClasspath
but when having the classes dirs there.Vampire
01/28/2024, 10:23 PMMartin
01/28/2024, 10:25 PM.kotlin-modules
or so) that's missing in the general .class case?Vampire
01/28/2024, 10:27 PMVampire
01/28/2024, 10:49 PMbuild/classes/kotlin/main
and build/resources/main
to build/combined
and used that, in the pluginClasspath
but it still failed with the problem.
Then I just did jar --create --file combined.jar -C combined .
and tried with combined.jar
instead of build/combined
et voila, the test succeeds. šVampire
01/28/2024, 10:55 PMcombined.jar
the test is green.
If I place in the same spot the Gradle-built jar, which according to IntelliJ diff is identical except for the Created-By
manifest entry, it fails with not finding a package in it.Vampire
01/28/2024, 10:55 PMVampire
01/28/2024, 11:05 PMMartin
01/28/2024, 11:14 PMMartin
01/28/2024, 11:14 PMVampire
01/28/2024, 11:15 PMVampire
01/28/2024, 11:17 PMbuild/tmp/functionalTest/work/.gradle-test-kit/
did not change anythingVampire
01/28/2024, 11:19 PMVampire
01/28/2024, 11:19 PMMartin
01/28/2024, 11:26 PMVampire
01/28/2024, 11:26 PMVampire
01/28/2024, 11:28 PM.withDebug(true)
=> fails with package in import not found
.withDebug(false)
=> worksVampire
01/28/2024, 11:32 PMVampire
01/28/2024, 11:32 PMVampire
01/28/2024, 11:42 PMVampire
01/29/2024, 4:40 PMimplementation(project())
⦠and putting the actual code jar in its default location to the pluginClasspath
⢠or
⦠have the classes directories on the test dependencies like with the default test
task
⦠and having the classes direcotries in the pluginClasspath
⢠and withDebug(true)
⢠and applying jacoco
plugin
then it fails to find the classes as the code is filtered out from the compile classpath before compiling the script in this line: https://github.com/gradle/gradle/blob/master/platforms/core-configuration/kotlin-d[ā¦]org/gradle/kotlin/dsl/provider/KotlinScriptClassPathProvider.ktVampire
01/29/2024, 4:40 PMMartin
01/29/2024, 4:51 PMMartin
01/29/2024, 4:52 PMVampire
01/29/2024, 4:52 PMVampire
01/29/2024, 4:54 PMpluginClasspath
has the classes in a different place than the "gradleImplementationClassPath", so that they are not filtered out.Vampire
01/29/2024, 4:56 PMVampire
01/29/2024, 4:57 PMMartin
01/29/2024, 4:58 PMVampire
01/29/2024, 4:58 PMVampire
01/29/2024, 5:02 PMVampire
01/29/2024, 5:25 PMVampire
01/29/2024, 5:31 PMbuildscript {
dependencies {
classpath(files("$codeJar"))
}
}
in the testee, forgot to mention that in the issue. š