Skip to content

Commit deaebf1

Browse files
committed
chore: testJvm is optional
1 parent 975044a commit deaebf1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

buildSrc/src/main/kotlin/datadog.test-jvm-contraints.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ tasks.withType<Test>().configureEach {
1717
return@configureEach
1818
}
1919

20-
inputs.property("testJvm", providers.gradleProperty("testJvm"))
20+
inputs.property("testJvm", testJvmSpec.testJvmProperty).optional(true)
2121

2222
val taskExtension = project.objects.newInstance<TestJvmConstraintsExtension>().also {
2323
configureConventions(it, projectExtension)

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ import java.nio.file.Files
99
import java.nio.file.Path
1010
import java.nio.file.Paths
1111

12+
1213
class TestJvmSpec(val project: Project) {
14+
companion object {
15+
const val TEST_JVM = "testJvm"
16+
}
17+
1318
private val currentJavaHomePath = project.providers.systemProperty("java.home").map { it.normalizeToJDKJavaHome() }
14-
val normalizedTestJvm = project.providers.gradleProperty("testJvm").map { testJvm ->
19+
20+
val testJvmProperty = project.providers.gradleProperty(TEST_JVM)
21+
22+
val normalizedTestJvm = testJvmProperty.map { testJvm ->
1523
if (testJvm.isBlank()) {
1624
throw GradleException("testJvm property is blank")
1725
}

0 commit comments

Comments
 (0)