Fix multi-jdk testing setup (#1086)

This changes the Gradle build to always create multi-jdk tasks,
and instead use the `enabled` property to determine whether the task
is actually ran or not.

The has the following benefits:
* IntelliJ and other tools understand the task execution graph (e.g. testJdk20 shows up as a task)
* JDK-specific Gradle configurations always exist, so `updateDependencyLocks` is consistent.
This commit is contained in:
Daniel Chao
2025-06-03 08:56:02 -07:00
committed by GitHub
parent 7d50c46c29
commit 4eeb61dc74
5 changed files with 21 additions and 25 deletions

View File

@@ -120,6 +120,7 @@ for (jdkTarget in buildInfo.jdkTestRange) {
} else {
val task =
tasks.register("testStartFatJarJdk${jdkTarget.asInt()}", Exec::class) {
enabled = buildInfo.isVersionEnabled(jdkTarget)
val launcher = project.javaToolchains.launcherFor { languageVersion = jdkTarget }
configureTestStartFatJar(launcher)
}