mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-03 15:59:31 +00:00
Address Gradle deprecation warnings
Closes gh-47876
This commit is contained in:
+2
-2
@@ -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"
|
||||
|
||||
+7
-1
@@ -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 {
|
||||
@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 {
|
||||
@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 {
|
||||
testSlices.addAll(readTestSlices(classesDir, metadataReaderFactory, springFactories));
|
||||
}
|
||||
}
|
||||
return new TestSliceMetadata(getProject().getName(), testSlices);
|
||||
return new TestSliceMetadata(getModuleName().get(), testSlices);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user