Browse Source

Replace deprecated method getBuildDir()

See gh-31416
pull/31491/head
Victor Georgescu 11 months ago committed by Stéphane Nicoll
parent
commit
35103b0cd1
  1. 3
      buildSrc/src/main/java/org/springframework/build/api/ApiDiffPlugin.java
  2. 2
      settings.gradle

3
buildSrc/src/main/java/org/springframework/build/api/ApiDiffPlugin.java

@ -131,7 +131,8 @@ public class ApiDiffPlugin implements Plugin<Project> { @@ -131,7 +131,8 @@ public class ApiDiffPlugin implements Plugin<Project> {
}
private File getOutputFile(String baseLineVersion, Project project) {
Path outDir = Paths.get(project.getRootProject().getBuildDir().getAbsolutePath(),
Path outDir = Paths.get(project.getRootProject()
.getLayout().getBuildDirectory().getAsFile().get().getAbsolutePath(),
"reports", "api-diff",
baseLineVersion + "_to_" + project.getRootProject().getVersion());
return project.file(outDir.resolve(project.getName() + ".html").toString());

2
settings.gradle

@ -47,7 +47,7 @@ rootProject.children.each {project -> @@ -47,7 +47,7 @@ rootProject.children.each {project ->
settings.gradle.projectsLoaded {
gradleEnterprise {
buildScan {
File buildDir = settings.gradle.rootProject.getBuildDir()
File buildDir = settings.gradle.rootProject.getLayout().getBuildDirectory().getAsFile().get()
buildDir.mkdirs()
new File(buildDir, "build-scan-uri.txt").text = "(build scan not generated)"
buildScanPublished { scan ->

Loading…
Cancel
Save