Drop support for Gradle 5.6.x
Closes gh-24225
This commit is contained in:
@@ -21,7 +21,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.gradle.api.JavaVersion;
|
||||
import org.gradle.util.GradleVersion;
|
||||
import org.junit.jupiter.api.TestTemplate;
|
||||
import org.junit.jupiter.api.extension.Extension;
|
||||
@@ -43,19 +42,8 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
final class GradleCompatibilityExtension implements TestTemplateInvocationContextProvider {
|
||||
|
||||
private static final List<String> GRADLE_VERSIONS;
|
||||
|
||||
static {
|
||||
JavaVersion javaVersion = JavaVersion.current();
|
||||
if (javaVersion.isCompatibleWith(JavaVersion.VERSION_14)
|
||||
|| javaVersion.isCompatibleWith(JavaVersion.VERSION_13)) {
|
||||
GRADLE_VERSIONS = Arrays.asList("6.3", "6.4.1", "6.5.1", "6.6.1", "6.7.1", "current", "7.0-milestone-3");
|
||||
}
|
||||
else {
|
||||
GRADLE_VERSIONS = Arrays.asList("5.6.4", "6.3", "6.4.1", "6.5.1", "6.6.1", "6.7.1", "current",
|
||||
"7.0-milestone-3");
|
||||
}
|
||||
}
|
||||
private static final List<String> GRADLE_VERSIONS = Arrays.asList("6.3", "6.4.1", "6.5.1", "6.6.1", "6.7.1",
|
||||
"current", "7.0-milestone-3");
|
||||
|
||||
@Override
|
||||
public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext context) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package org.springframework.boot.gradle.plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.gradle.testkit.runner.BuildResult;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.DisabledForJreRange;
|
||||
@@ -40,34 +37,12 @@ class SpringBootPluginIntegrationTests {
|
||||
|
||||
final GradleBuild gradleBuild = new GradleBuild();
|
||||
|
||||
@DisabledForJreRange(min = JRE.JAVA_14)
|
||||
@Test
|
||||
void failFastWithVersionOfGradle5LowerThanRequired() {
|
||||
BuildResult result = this.gradleBuild.gradleVersion("5.5.1").buildAndFail();
|
||||
assertThat(result.getOutput())
|
||||
.contains("Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). "
|
||||
+ "The current version is Gradle 5.5.1");
|
||||
}
|
||||
|
||||
@DisabledForJreRange(min = JRE.JAVA_14)
|
||||
@Test
|
||||
void failFastWithVersionOfGradle6LowerThanRequired() {
|
||||
BuildResult result = this.gradleBuild.gradleVersion("6.2.2").buildAndFail();
|
||||
assertThat(result.getOutput())
|
||||
.contains("Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). "
|
||||
+ "The current version is Gradle 6.2.2");
|
||||
}
|
||||
|
||||
@DisabledForJreRange(min = JRE.JAVA_13)
|
||||
@Test
|
||||
void succeedWithVersionOfGradle5HigherThanRequired() {
|
||||
this.gradleBuild.gradleVersion("5.6.1").build();
|
||||
}
|
||||
|
||||
@DisabledForJreRange(min = JRE.JAVA_13)
|
||||
@Test
|
||||
void succeedWithVersionOfGradle5MatchingWhatIsRequired() {
|
||||
this.gradleBuild.gradleVersion("5.6").build();
|
||||
.contains("Spring Boot plugin requires Gradle 6 (6.3 or later). The current version is Gradle 6.2.2");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -75,10 +50,4 @@ class SpringBootPluginIntegrationTests {
|
||||
this.gradleBuild.gradleVersion("6.3").build();
|
||||
}
|
||||
|
||||
private void createMinimalMainSource() throws IOException {
|
||||
File examplePackage = new File(this.gradleBuild.getProjectDir(), "src/main/java/com/example");
|
||||
examplePackage.mkdirs();
|
||||
new File(examplePackage, "Application.java").createNewFile();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user