mirror of
https://gitee.com/dcren/initializr.git
synced 2025-04-05 17:38:06 +08:00
Fix handling of source compatibility with recent Java versions
See gh-1443
This commit is contained in:
parent
68ca360125
commit
6464c7df28
@ -100,7 +100,7 @@ public class KotlinDslGradleBuildWriter extends GradleBuildWriter {
|
||||
if (generation >= 1 && generation <= 10) {
|
||||
sb.append("VERSION_1_").append(generation);
|
||||
}
|
||||
else if (generation <= 17) {
|
||||
else if (generation <= 24) {
|
||||
sb.append("VERSION_").append(generation);
|
||||
}
|
||||
else {
|
||||
|
@ -57,7 +57,7 @@ class KotlinDslGradleBuildWriterTests extends GradleBuildWriterTests {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("sourceCompatibilityParameters")
|
||||
void gradleBuildWithSourceCompatibility15(String sourceCompatibility, String javaVersionConstant) {
|
||||
void gradleBuildWithSourceCompatibilities(String sourceCompatibility, String javaVersionConstant) {
|
||||
GradleBuild build = new GradleBuild();
|
||||
build.settings().sourceCompatibility(sourceCompatibility);
|
||||
assertThat(write(build)).contains("""
|
||||
@ -82,7 +82,9 @@ class KotlinDslGradleBuildWriterTests extends GradleBuildWriterTests {
|
||||
Arguments.arguments("15", "JavaVersion.VERSION_15"),
|
||||
Arguments.arguments("16", "JavaVersion.VERSION_16"),
|
||||
Arguments.arguments("17", "JavaVersion.VERSION_17"),
|
||||
Arguments.arguments("18", "JavaVersion.VERSION_HIGHER"));
|
||||
Arguments.arguments("18", "JavaVersion.VERSION_18"),
|
||||
Arguments.arguments("24", "JavaVersion.VERSION_24"),
|
||||
Arguments.arguments("25", "JavaVersion.VERSION_HIGHER"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user