Browse Source

Address Gradle deprecation warnings

Closes gh-47876
pull/47903/head
Andy Wilkinson 3 months ago
parent
commit
45978e2069
  1. 4
      build.gradle
  2. 8
      buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/GenerateTestSliceMetadata.java
  3. 13
      cli/spring-boot-cli/build.gradle

4
build.gradle

@ -32,8 +32,8 @@ subprojects { @@ -32,8 +32,8 @@ subprojects {
repositories {
mavenCentral()
maven {
name "Shibboleth Releases"
url "https://build.shibboleth.net/nexus/content/repositories/releases"
name = "Shibboleth Releases"
url = "https://build.shibboleth.net/nexus/content/repositories/releases"
content {
includeGroup "org.opensaml"
includeGroup "net.shibboleth"

8
buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/GenerateTestSliceMetadata.java

@ -39,7 +39,9 @@ import org.gradle.api.Task; @@ -39,7 +39,9 @@ import org.gradle.api.Task;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Classpath;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.PathSensitive;
@ -73,6 +75,7 @@ public abstract class GenerateTestSliceMetadata extends DefaultTask { @@ -73,6 +75,7 @@ public abstract class GenerateTestSliceMetadata extends DefaultTask {
@Inject
public GenerateTestSliceMetadata(ObjectFactory objectFactory) {
this.objectFactory = objectFactory;
this.getModuleName().convention(getProject().getName());
}
public void setSourceSet(SourceSet sourceSet) {
@ -91,6 +94,9 @@ public abstract class GenerateTestSliceMetadata extends DefaultTask { @@ -91,6 +94,9 @@ public abstract class GenerateTestSliceMetadata extends DefaultTask {
@PathSensitive(PathSensitivity.RELATIVE)
abstract RegularFileProperty getSpringFactories();
@Input
public abstract Property<String> getModuleName();
@Classpath
FileCollection getClasspath() {
return this.classpath;
@ -126,7 +132,7 @@ public abstract class GenerateTestSliceMetadata extends DefaultTask { @@ -126,7 +132,7 @@ public abstract class GenerateTestSliceMetadata extends DefaultTask {
testSlices.addAll(readTestSlices(classesDir, metadataReaderFactory, springFactories));
}
}
return new TestSliceMetadata(getProject().getName(), testSlices);
return new TestSliceMetadata(getModuleName().get(), testSlices);
}
/**

13
cli/spring-boot-cli/build.gradle

@ -127,23 +127,20 @@ tasks.register("tar", Tar) { @@ -127,23 +127,20 @@ tasks.register("tar", Tar) {
}
if (BuildProperties.get(project).buildType() == BuildType.OPEN_SOURCE) {
tasks.register("homebrewFormula", org.springframework.boot.build.cli.HomebrewFormula) {
def homebrewFormula = tasks.register("homebrewFormula", org.springframework.boot.build.cli.HomebrewFormula) {
dependsOn tar
outputDir = layout.buildDirectory.dir("homebrew")
template = file("src/main/homebrew/spring-boot.rb")
archive = tar.archiveFile
}
def homebrewFormulaArtifact = artifacts.add("archives", file(layout.buildDirectory.file("homebrew/spring-boot.rb"))) {
type = "rb"
classifier = "homebrew"
builtBy "homebrewFormula"
}
publishing {
publications {
getByName("maven") {
artifact homebrewFormulaArtifact
artifact(homebrewFormula.map { it.outputDir.file("spring-boot.rb") }) { formula ->
formula.classifier = "homebrew"
formula.extension = "rb"
}
}
}
}

Loading…
Cancel
Save