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
@@ -20,6 +20,7 @@ import org.gradle.accessors.dm.LibrariesForLibs
plugins {
`java-library`
`jvm-toolchains`
`jvm-test-suite`
id("pklKotlinTest")
id("com.diffplug.spotless")
}
@@ -135,4 +136,4 @@ tasks.test { configureJdkTestTask(info.javaTestLauncher) }
// inherits the configuration of the default `test` task (aside from an overridden launcher).
val jdkTestTasks = info.multiJdkTestingWith(tasks.test) { (_, jdk) -> configureJdkTestTask(jdk) }
if (info.multiJdkTesting) tasks.check { dependsOn(jdkTestTasks) }
tasks.check { dependsOn(jdkTestTasks) }