Skip to content

Commit eefaeb9

Browse files
committed
build: Remove nullable type in TestJvmSpec
Gradle 9 prevent the declaration of nullable types in the Provider API.
1 parent 10e03bd commit eefaeb9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints

buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import org.gradle.jvm.toolchain.JvmImplementation
1414
import org.gradle.jvm.toolchain.JvmVendorSpec
1515
import org.gradle.jvm.toolchain.internal.DefaultToolchainSpec
1616
import org.gradle.jvm.toolchain.internal.SpecificInstallationToolchainSpec
17+
import org.gradle.kotlin.dsl.property
1718
import org.gradle.kotlin.dsl.support.serviceOf
1819
import java.nio.file.Files
1920
import java.nio.file.Path
@@ -151,7 +152,7 @@ class TestJvmSpec(val project: Project) {
151152
project.providers.zip(testJvmSpec, normalizedTestJvm) { jvmSpec, testJvm ->
152153
// Only change test JVM if it's not the one we are running the gradle build with
153154
if ((jvmSpec as? SpecificInstallationToolchainSpec)?.javaHome == currentJavaHomePath.get()) {
154-
project.providers.provider<JavaLauncher?> { null }
155+
project.objects.property<JavaLauncher>()
155156
} else {
156157
// The provider always says that a value is present so we need to wrap it for proper error messages
157158
project.javaToolchains.launcherFor(jvmSpec).orElse(project.providers.provider {

0 commit comments

Comments
 (0)