mirror of
https://github.com/apple/pkl.git
synced 2026-03-30 05:41:54 +02:00
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:
@@ -84,6 +84,7 @@ val testStartJavaExecutable by tasks.registering { setupTestStartJavaExecutable(
|
||||
val testStartJavaExecutableOnOtherJdks =
|
||||
buildInfo.jdkTestRange.map { jdkTarget ->
|
||||
tasks.register("testStartJavaExecutableJdk${jdkTarget.asInt()}") {
|
||||
enabled = buildInfo.isVersionEnabled(jdkTarget)
|
||||
val toolChainService: JavaToolchainService = serviceOf()
|
||||
val launcher = toolChainService.launcherFor { languageVersion = jdkTarget }
|
||||
setupTestStartJavaExecutable(launcher)
|
||||
@@ -94,9 +95,7 @@ tasks.assemble { dependsOn(javaExecutable) }
|
||||
|
||||
tasks.check {
|
||||
dependsOn(testStartJavaExecutable)
|
||||
if (buildInfo.multiJdkTesting) {
|
||||
dependsOn(testStartJavaExecutableOnOtherJdks)
|
||||
}
|
||||
dependsOn(testStartJavaExecutableOnOtherJdks)
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
||||
Reference in New Issue
Block a user