diff --git a/.gitlab/upload_ciapp.sh b/.gitlab/upload_ciapp.sh index cb9199b8625..bcbcf5d5466 100755 --- a/.gitlab/upload_ciapp.sh +++ b/.gitlab/upload_ciapp.sh @@ -16,6 +16,10 @@ if [ -n "$TEST_JVM" ]; then for var in $(compgen -v JAVA_ | grep -E '^JAVA_[0-9]+_HOME$'); do ver="${var#JAVA_}" ver="${ver%_HOME}" + # TODO(JDK-28-EA): remove after GA (tip will move to 28) + if [ "$ver" = "28" ]; then + continue + fi if [ "$ver" -gt "$MAX_VER" ] 2>/dev/null; then MAX_VER="$ver" fi diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt index 0765acb988a..76c9f770e44 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt @@ -35,6 +35,16 @@ import java.nio.file.Paths class TestJvmSpec(val project: Project) { companion object { const val TEST_JVM = "testJvm" + + // TODO(JDK-28-EA): remove after GA (tip will move to 28) + internal fun resolveTipJavaVersion(javaVersions: List): String { + val tipJavaVersions = javaVersions.filterNot { it == 28 } + if (tipJavaVersions.isEmpty()) { + throw GradleException("No Java installations found for tip after excluding Java 28.") + } + + return tipJavaVersions.max().toString() + } } /** @@ -59,7 +69,7 @@ class TestJvmSpec(val project: Project) { throw GradleException("No Java installations found via toolchains or JAVA_X_HOME environment variables.") } - javaVersions.max().toString() + resolveTipJavaVersion(javaVersions) // TODO(JDK-28-EA): revert back to "javaVersions.max().toString()" after GA } else -> testJvm