Polish "Use project.getLayout().getBuildDirectory() instead of getBuildDir()"

See gh-37167
pull/37210/head
Andy Wilkinson 1 year ago
parent a8706962d4
commit a77863245d

@ -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"
}

@ -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…
Cancel
Save