Browse Source

Test our Gradle plugin against 7.1-rc-1

7.1-rc-1 deprecates JavaExec's main property in favor of mainClass
which was introduced in Gradle 6.4. This commit updates some tests
to use mainClass rather than main that would otherwise have failed
due to deprecation warnings in their output.

Closes gh-26793
pull/26813/head
Andy Wilkinson 5 years ago
parent
commit
87d35250a5
  1. 4
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java
  2. 2
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle
  3. 2
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsNotUsedWhenItIsNull.gradle

4
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java

@ -48,10 +48,10 @@ final class GradleCompatibilityExtension implements TestTemplateInvocationContex @@ -48,10 +48,10 @@ final class GradleCompatibilityExtension implements TestTemplateInvocationContex
static {
JavaVersion javaVersion = JavaVersion.current();
if (javaVersion.isCompatibleWith(JavaVersion.VERSION_16)) {
GRADLE_VERSIONS = Arrays.asList("7.0.2");
GRADLE_VERSIONS = Arrays.asList("7.0.2", "7.1-rc-1");
}
else {
GRADLE_VERSIONS = Arrays.asList("6.8.3", "current", "7.0.2");
GRADLE_VERSIONS = Arrays.asList("6.8.3", "current", "7.0.2", "7.1-rc-1");
}
}

2
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle

@ -21,5 +21,5 @@ task explode(type: Sync) { @@ -21,5 +21,5 @@ task explode(type: Sync) {
task launch(type: JavaExec) {
classpath = files(explode)
main = 'org.springframework.boot.loader.JarLauncher'
mainClass = 'org.springframework.boot.loader.JarLauncher'
}

2
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsNotUsedWhenItIsNull.gradle

@ -5,6 +5,6 @@ plugins { @@ -5,6 +5,6 @@ plugins {
bootRun {
doFirst {
println "Main class name = ${bootRun.main}"
println "Main class name = ${bootRun.mainClass.get()}"
}
}
Loading…
Cancel
Save