mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge pull request #37167 from quaff
* gh-37167: Polish "Use project.getLayout().getBuildDirectory() instead of getBuildDir()" Use project.getLayout().getBuildDirectory() instead of getBuildDir() Closes gh-37167
This commit is contained in:
commit
49cf62d97c
@ -48,7 +48,7 @@ gradlePlugin {
|
||||
}
|
||||
|
||||
task preparePluginValidationClasses(type: Copy) {
|
||||
destinationDir = file("$buildDir/classes/java/pluginValidation")
|
||||
destinationDir = layout.buildDirectory.dir("classes/java/pluginValidation").get().asFile
|
||||
from(sourceSets.main.output.classesDirs) {
|
||||
exclude "**/CreateBootStartScripts.class"
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.boot.gradle.plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.StringWriter;
|
||||
@ -79,7 +78,7 @@ final class ApplicationPluginAction implements PluginApplicationAction {
|
||||
}
|
||||
});
|
||||
createStartScripts.getConventionMapping()
|
||||
.map("outputDir", () -> new File(project.getBuildDir(), "bootScripts"));
|
||||
.map("outputDir", () -> project.getLayout().getBuildDirectory().dir("bootScripts").get().getAsFile());
|
||||
createStartScripts.getConventionMapping().map("applicationName", javaApplication::getApplicationName);
|
||||
createStartScripts.getConventionMapping().map("defaultJvmOpts", javaApplication::getApplicationDefaultJvmArgs);
|
||||
}
|
||||
|
@ -22,9 +22,9 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gradle.api.Action;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.Task;
|
||||
import org.gradle.api.file.DirectoryProperty;
|
||||
import org.gradle.api.file.ProjectLayout;
|
||||
import org.gradle.api.internal.ConventionTask;
|
||||
import org.gradle.api.tasks.Nested;
|
||||
import org.gradle.api.tasks.OutputDirectory;
|
||||
@ -75,7 +75,8 @@ public class BuildInfo extends ConventionTask {
|
||||
|
||||
/**
|
||||
* Returns the directory to which the {@code build-info.properties} file will be
|
||||
* written. Defaults to the {@link Project#getBuildDir() Project's build directory}.
|
||||
* written. Defaults to the {@link ProjectLayout#getBuildDirectory() Project's build
|
||||
* directory}.
|
||||
* @return the destination directory
|
||||
*/
|
||||
@OutputDirectory
|
||||
|
@ -5,7 +5,6 @@ plugins {
|
||||
version = '0.1.0'
|
||||
|
||||
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
|
||||
destinationDir project.buildDir
|
||||
properties {
|
||||
artifact = 'foo'
|
||||
group = 'foo'
|
||||
|
@ -6,7 +6,6 @@ group = 'foo'
|
||||
version = '0.1.0'
|
||||
|
||||
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
|
||||
destinationDir project.buildDir
|
||||
properties {
|
||||
group = ''
|
||||
artifact = ''
|
||||
|
@ -6,7 +6,6 @@ group = 'foo'
|
||||
version = '0.1.0'
|
||||
|
||||
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
|
||||
destinationDir project.buildDir
|
||||
properties {
|
||||
group = null
|
||||
artifact = null
|
||||
|
@ -15,7 +15,7 @@ dependencies {
|
||||
|
||||
task explode(type: Sync) {
|
||||
dependsOn(bootJar)
|
||||
destinationDir = file("$buildDir/exploded")
|
||||
destinationDir = layout.buildDirectory.dir("exploded").get().asFile
|
||||
from zipTree(files(bootJar).singleFile)
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ version = '1.0'
|
||||
uploadBootArchives {
|
||||
repositories {
|
||||
mavenDeployer {
|
||||
repository(url: "file:${buildDir}/repo")
|
||||
repository(url: "file:${layout.buildDirectory.dir("repo").get().asFile}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ version = '1.0'
|
||||
uploadBootArchives {
|
||||
repositories {
|
||||
mavenDeployer {
|
||||
repository(url: "file:${buildDir}/repo")
|
||||
repository(url: "file:${layout.buildDirectory.dir("repo").get().asFile}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ version = '1.0'
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url "${buildDir}/repo"
|
||||
url = layout.buildDirectory.dir("repo")
|
||||
}
|
||||
}
|
||||
publications {
|
||||
|
@ -14,7 +14,7 @@ version = '1.0'
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url "${buildDir}/repo"
|
||||
url = layout.buildDirectory.dir("repo")
|
||||
}
|
||||
}
|
||||
publications {
|
||||
|
Loading…
Reference in New Issue
Block a user