mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-24 10:19:03 +00:00
Upgrade to Gradle 9.6.1
This commit also suppresses new warnings from the Native Build Tools Plugin, see https://github.com/graalvm/native-build-tools/pull/903 Closes gh-50793
This commit is contained in:
+18
-8
@@ -47,19 +47,23 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@GradleCompatibility(minimumVersion = "8.3")
|
||||
class NativeImagePluginActionIntegrationTests {
|
||||
|
||||
private static final String NATIVE_BUILD_TOOLS_DEPRECATION = "Using a Project object as a dependency notation has been deprecated";
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
GradleBuild gradleBuild;
|
||||
|
||||
@TestTemplate
|
||||
void applyingNativeImagePluginAppliesAotPlugin() {
|
||||
assertThat(this.gradleBuild.build("aotPluginApplied").getOutput())
|
||||
.contains("org.springframework.boot.aot applied = true");
|
||||
assertThat(this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION)
|
||||
.build("aotPluginApplied")
|
||||
.getOutput()).contains("org.springframework.boot.aot applied = true");
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void reachabilityMetadataConfigurationFilesAreCopiedToJar() throws IOException {
|
||||
writeDummySpringApplicationAotProcessorMainClass();
|
||||
BuildResult result = this.gradleBuild.build("bootJar");
|
||||
BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION)
|
||||
.build("bootJar");
|
||||
BuildTask task = result.task(":bootJar");
|
||||
assertThat(task).isNotNull();
|
||||
assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
@@ -79,7 +83,8 @@ class NativeImagePluginActionIntegrationTests {
|
||||
writeDummySpringApplicationAotProcessorMainClass();
|
||||
FileSystemUtils.copyRecursively(new File("src/test/resources/reachability-metadata-repository"),
|
||||
new File(this.gradleBuild.getProjectDir(), "reachability-metadata-repository"));
|
||||
BuildResult result = this.gradleBuild.build("bootJar");
|
||||
BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION)
|
||||
.build("bootJar");
|
||||
BuildTask task = result.task(":bootJar");
|
||||
assertThat(task).isNotNull();
|
||||
assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
@@ -97,20 +102,23 @@ class NativeImagePluginActionIntegrationTests {
|
||||
@TestTemplate
|
||||
void developmentOnlyDependenciesDoNotAppearInNativeImageClasspath() {
|
||||
writeDummySpringApplicationAotProcessorMainClass();
|
||||
BuildResult result = this.gradleBuild.build("checkNativeImageClasspath");
|
||||
BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION)
|
||||
.build("checkNativeImageClasspath");
|
||||
assertThat(result.getOutput()).doesNotContain("commons-lang");
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void testAndDevelopmentOnlyDependenciesDoNotAppearInNativeImageClasspath() {
|
||||
writeDummySpringApplicationAotProcessorMainClass();
|
||||
BuildResult result = this.gradleBuild.build("checkNativeImageClasspath");
|
||||
BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION)
|
||||
.build("checkNativeImageClasspath");
|
||||
assertThat(result.getOutput()).doesNotContain("commons-lang");
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void classesGeneratedDuringAotProcessingAreOnTheNativeImageClasspath() {
|
||||
BuildResult result = this.gradleBuild.build("checkNativeImageClasspath");
|
||||
BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION)
|
||||
.build("checkNativeImageClasspath");
|
||||
assertThat(result.getOutput()).contains(projectPath("build/classes/java/aot"),
|
||||
projectPath("build/resources/aot"), projectPath("build/generated/aotClasses"));
|
||||
}
|
||||
@@ -119,6 +127,7 @@ class NativeImagePluginActionIntegrationTests {
|
||||
void classesGeneratedDuringAotTestProcessingAreOnTheTestNativeImageClasspath() {
|
||||
BuildResult result = this.gradleBuild
|
||||
.scriptProperty("junitVersion", TestTemplate.class.getPackage().getImplementationVersion())
|
||||
.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION)
|
||||
.build("checkTestNativeImageClasspath");
|
||||
assertThat(result.getOutput()).contains(projectPath("build/classes/java/aotTest"),
|
||||
projectPath("build/resources/aotTest"), projectPath("build/generated/aotTestClasses"));
|
||||
@@ -127,7 +136,8 @@ class NativeImagePluginActionIntegrationTests {
|
||||
@TestTemplate
|
||||
void nativeEntryIsAddedToManifest() throws IOException {
|
||||
writeDummySpringApplicationAotProcessorMainClass();
|
||||
BuildResult result = this.gradleBuild.build("bootJar");
|
||||
BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION)
|
||||
.build("bootJar");
|
||||
BuildTask task = result.task(":bootJar");
|
||||
assertThat(task).isNotNull();
|
||||
assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
# ksh gradlew
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
|
||||
Vendored
+2
-2
@@ -19,7 +19,7 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem gradlew startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@@ -72,7 +72,7 @@ echo location of your Java installation. 1>&2
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
Reference in New Issue
Block a user