Replace deprecated method getBuildDir()

See gh-31416
This commit is contained in:
Victor Georgescu 2023-10-11 23:58:32 +03:00 committed by Stéphane Nicoll
parent 3b50f992fe
commit 35103b0cd1
2 changed files with 3 additions and 2 deletions

View File

@ -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());

View File

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