Skip to content

Commit

Permalink
For tests, adjust gradle versions that are compatible with Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurz committed May 3, 2024
1 parent d135d94 commit 9f8956c
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,17 @@ protected BuildResult build(String gradleVersion, String... args) {
}

static Stream<String> gradleVersions() {
// https://docs.gradle.org/current/userguide/scala_plugin.html#sec:configure_zinc_compiler
if (getScalaVersion().equals("3")) { // Gradle 7.5+
return Stream.of("7.6.2", "8.0.2", "8.7");
}
// https://docs.gradle.org/current/userguide/compatibility.html
if (JavaVersion.current().compareTo(JavaVersion.VERSION_21) >= 0) { // Gradle 8.4+
return Stream.of("8.7");
}
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) >= 0) { // Gradle 7.3+
return Stream.of("7.6.2", "8.0.2", "8.7");
}
// https://docs.gradle.org/current/userguide/scala_plugin.html#sec:configure_zinc_compiler
if (getScalaVersion().equals("3")) { // Gradle 7.5+
return Stream.of("7.6.2", "8.0.2", "8.7");
}
return Stream.of("7.1.1", "7.6.2", "8.0.2", "8.7");
}
}

0 comments on commit 9f8956c

Please sign in to comment.