Skip to content

Commit

Permalink
Tolerate deprecation warnings generated by Gradle 6.4
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wilkinsona committed May 6, 2020
1 parent 02aacf4 commit 693fa91
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
Expand Up @@ -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) {
enforcedPlatform(":spring-boot-project:spring-boot-dependencies")
}
Expand Down
Expand Up @@ -79,8 +79,8 @@ void createsBootStartScriptsTaskUsesApplicationPluginsDefaultJvmOpts() {

@TestTemplate
void zipDistributionForJarCanBeBuilt() throws IOException {
assertThat(this.gradleBuild.build("bootDistZip").task(":bootDistZip").getOutcome())
.isEqualTo(TaskOutcome.SUCCESS);
assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistZip")
.task(":bootDistZip").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.zip");
assertThat(distribution).isFile();
Expand All @@ -91,8 +91,8 @@ void zipDistributionForJarCanBeBuilt() throws IOException {

@TestTemplate
void tarDistributionForJarCanBeBuilt() throws IOException {
assertThat(this.gradleBuild.build("bootDistTar").task(":bootDistTar").getOutcome())
.isEqualTo(TaskOutcome.SUCCESS);
assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistTar")
.task(":bootDistTar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.tar");
assertThat(distribution).isFile();
Expand All @@ -103,8 +103,8 @@ void tarDistributionForJarCanBeBuilt() throws IOException {

@TestTemplate
void zipDistributionForWarCanBeBuilt() throws IOException {
assertThat(this.gradleBuild.build("bootDistZip").task(":bootDistZip").getOutcome())
.isEqualTo(TaskOutcome.SUCCESS);
assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistZip")
.task(":bootDistZip").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.zip");
assertThat(distribution).isFile();
Expand All @@ -115,8 +115,8 @@ void zipDistributionForWarCanBeBuilt() throws IOException {

@TestTemplate
void tarDistributionForWarCanBeBuilt() throws IOException {
assertThat(this.gradleBuild.build("bootDistTar").task(":bootDistTar").getOutcome())
.isEqualTo(TaskOutcome.SUCCESS);
assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistTar")
.task(":bootDistTar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.tar");
assertThat(distribution).isFile();
Expand All @@ -127,8 +127,8 @@ void tarDistributionForWarCanBeBuilt() throws IOException {

@TestTemplate
void applicationNameCanBeUsedToCustomizeDistributionName() throws IOException {
assertThat(this.gradleBuild.build("bootDistTar").task(":bootDistTar").getOutcome())
.isEqualTo(TaskOutcome.SUCCESS);
assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistTar")
.task(":bootDistTar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/custom-boot.tar");
assertThat(distribution).isFile();
String name = this.gradleBuild.getProjectDir().getName();
Expand All @@ -139,8 +139,8 @@ void applicationNameCanBeUsedToCustomizeDistributionName() throws IOException {

@TestTemplate
void scriptsHaveCorrectPermissions() throws IOException {
assertThat(this.gradleBuild.build("bootDistTar").task(":bootDistTar").getOutcome())
.isEqualTo(TaskOutcome.SUCCESS);
assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.4").build("bootDistTar")
.task(":bootDistTar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String name = this.gradleBuild.getProjectDir().getName();
File distribution = new File(this.gradleBuild.getProjectDir(), "build/distributions/" + name + "-boot.tar");
assertThat(distribution).isFile();
Expand Down

0 comments on commit 693fa91

Please sign in to comment.