Merge branch '2.2.x'
Closes gh-21112
This commit is contained in:
@@ -17,8 +17,12 @@
|
||||
package org.springframework.boot.gradle.tasks.bundling;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.gradle.api.artifacts.ArtifactCollection;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
@@ -92,6 +96,10 @@ class LayerResolver {
|
||||
*/
|
||||
private static class ResolvedDependencies {
|
||||
|
||||
private static final Set<String> DEPRECATED_FOR_RESOLUTION_CONFIGURATIONS = Collections
|
||||
.unmodifiableSet(new HashSet<>(Arrays.asList("archives", "compile", "compileOnly", "default", "runtime",
|
||||
"testCompile", "testCompileOnly", "testRuntime")));
|
||||
|
||||
private final Map<Configuration, ResolvedConfigurationDependencies> configurationDependencies = new LinkedHashMap<>();
|
||||
|
||||
ResolvedDependencies(Iterable<Configuration> configurations) {
|
||||
@@ -99,7 +107,8 @@ class LayerResolver {
|
||||
}
|
||||
|
||||
private void processConfiguration(Configuration configuration) {
|
||||
if (configuration.isCanBeResolved()) {
|
||||
if (configuration.isCanBeResolved()
|
||||
&& !DEPRECATED_FOR_RESOLUTION_CONFIGURATIONS.contains(configuration.getName())) {
|
||||
this.configurationDependencies.put(configuration,
|
||||
new ResolvedConfigurationDependencies(configuration.getIncoming().getArtifacts()));
|
||||
}
|
||||
|
||||
@@ -39,8 +39,9 @@ class PublishingDocumentationTests {
|
||||
|
||||
@TestTemplate
|
||||
void mavenUpload() throws IOException {
|
||||
assertThat(this.gradleBuild.script("src/docs/gradle/publishing/maven").build("deployerRepository").getOutput())
|
||||
.contains("https://repo.example.com");
|
||||
assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("5.6")
|
||||
.script("src/docs/gradle/publishing/maven").build("deployerRepository").getOutput())
|
||||
.contains("https://repo.example.com");
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
|
||||
@@ -89,7 +89,7 @@ public class GradleBuild {
|
||||
}
|
||||
|
||||
void after() {
|
||||
GradleBuild.this.script = null;
|
||||
this.script = null;
|
||||
FileSystemUtils.deleteRecursively(this.projectDir);
|
||||
}
|
||||
|
||||
@@ -127,8 +127,8 @@ public class GradleBuild {
|
||||
public BuildResult build(String... arguments) {
|
||||
try {
|
||||
BuildResult result = prepareRunner(arguments).build();
|
||||
if (this.gradleVersion != null && this.expectDeprecationWarnings != null
|
||||
&& this.expectDeprecationWarnings.compareTo(GradleVersion.version(this.gradleVersion)) > 0) {
|
||||
if (this.expectDeprecationWarnings == null || (this.gradleVersion != null
|
||||
&& this.expectDeprecationWarnings.compareTo(GradleVersion.version(this.gradleVersion)) > 0)) {
|
||||
assertThat(result.getOutput()).doesNotContain("Deprecated").doesNotContain("deprecated");
|
||||
}
|
||||
return result;
|
||||
@@ -167,6 +167,8 @@ public class GradleBuild {
|
||||
allArguments.add("-PbootVersion=" + getBootVersion());
|
||||
allArguments.add("--stacktrace");
|
||||
allArguments.addAll(Arrays.asList(arguments));
|
||||
allArguments.add("--warning-mode");
|
||||
allArguments.add("all");
|
||||
return gradleRunner.withArguments(allArguments);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user