Tolerate deprecation warnings generated by Gradle 6.4

The warnings will be addressed by gh-20759. CreateBootStartScripts
must be excluded from the classes that are validated by the
ValidatePlugins task. It is invalid, but only for Gradle 6.4. gh-20759
will cause it to only be used with Gradle 6.3 and earlier.

See gh-21329
pull/21361/head
Andy Wilkinson 5 years ago
parent 02aacf4f04
commit 693fa918e2

@ -56,6 +56,17 @@ gradlePlugin {
} }
} }
task preparePluginValidationClasses(type: Copy) {
destinationDir = file("$buildDir/classes/java/pluginValidation")
from(sourceSets.main.output.classesDirs) {
exclude "**/CreateBootStartScripts.class"
}
}
validatePlugins {
classes.setFrom preparePluginValidationClasses
}
task dependencyVersions(type: org.springframework.boot.build.constraints.ExtractVersionConstraints) { task dependencyVersions(type: org.springframework.boot.build.constraints.ExtractVersionConstraints) {
enforcedPlatform(":spring-boot-project:spring-boot-dependencies") enforcedPlatform(":spring-boot-project:spring-boot-dependencies")
} }

@ -79,8 +79,8 @@ class ApplicationPluginActionIntegrationTests {
@TestTemplate @TestTemplate
void zipDistributionForJarCanBeBuilt() throws IOException { void zipDistributionForJarCanBeBuilt() throws IOException {
assertThat(this.gradleBuild.build("bootDistZip").task(":bootDistZip").getOutcome()) assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistZip")
.isEqualTo(TaskOutcome.SUCCESS); .task(":bootDistZip").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName(); String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.zip"); File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.zip");
assertThat(distribution).isFile(); assertThat(distribution).isFile();
@ -91,8 +91,8 @@ class ApplicationPluginActionIntegrationTests {
@TestTemplate @TestTemplate
void tarDistributionForJarCanBeBuilt() throws IOException { void tarDistributionForJarCanBeBuilt() throws IOException {
assertThat(this.gradleBuild.build("bootDistTar").task(":bootDistTar").getOutcome()) assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistTar")
.isEqualTo(TaskOutcome.SUCCESS); .task(":bootDistTar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName(); String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.tar"); File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.tar");
assertThat(distribution).isFile(); assertThat(distribution).isFile();
@ -103,8 +103,8 @@ class ApplicationPluginActionIntegrationTests {
@TestTemplate @TestTemplate
void zipDistributionForWarCanBeBuilt() throws IOException { void zipDistributionForWarCanBeBuilt() throws IOException {
assertThat(this.gradleBuild.build("bootDistZip").task(":bootDistZip").getOutcome()) assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistZip")
.isEqualTo(TaskOutcome.SUCCESS); .task(":bootDistZip").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName(); String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.zip"); File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.zip");
assertThat(distribution).isFile(); assertThat(distribution).isFile();
@ -115,8 +115,8 @@ class ApplicationPluginActionIntegrationTests {
@TestTemplate @TestTemplate
void tarDistributionForWarCanBeBuilt() throws IOException { void tarDistributionForWarCanBeBuilt() throws IOException {
assertThat(this.gradleBuild.build("bootDistTar").task(":bootDistTar").getOutcome()) assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistTar")
.isEqualTo(TaskOutcome.SUCCESS); .task(":bootDistTar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName(); String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.tar"); File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.tar");
assertThat(distribution).isFile(); assertThat(distribution).isFile();
@ -127,8 +127,8 @@ class ApplicationPluginActionIntegrationTests {
@TestTemplate @TestTemplate
void applicationNameCanBeUsedToCustomizeDistributionName() throws IOException { void applicationNameCanBeUsedToCustomizeDistributionName() throws IOException {
assertThat(this.gradleBuild.build("bootDistTar").task(":bootDistTar").getOutcome()) assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistTar")
.isEqualTo(TaskOutcome.SUCCESS); .task(":bootDistTar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/custom-boot.tar"); File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/custom-boot.tar");
assertThat(distribution).isFile(); assertThat(distribution).isFile();
String name = this.gradleBuild.getProjectDir().getName(); String name = this.gradleBuild.getProjectDir().getName();
@ -139,8 +139,8 @@ class ApplicationPluginActionIntegrationTests {
@TestTemplate @TestTemplate
void scriptsHaveCorrectPermissions() throws IOException { void scriptsHaveCorrectPermissions() throws IOException {
assertThat(this.gradleBuild.build("bootDistTar").task(":bootDistTar").getOutcome()) assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistTar")
.isEqualTo(TaskOutcome.SUCCESS); .task(":bootDistTar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName(); String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.tar"); File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.tar");
assertThat(distribution).isFile(); assertThat(distribution).isFile();

Loading…
Cancel
Save