Skip to content

Commit d05ac09

Browse files
committed
Polish "Replace deprecated method getBuildDir()"
See gh-31416
1 parent 35103b0 commit d05ac09

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -131,9 +131,9 @@ private Configuration getRuntimeClassPath(Project project) {
131131
}
132132

133133
private File getOutputFile(String baseLineVersion, Project project) {
134-
Path outDir = Paths.get(project.getRootProject()
135-
.getLayout().getBuildDirectory().getAsFile().get().getAbsolutePath(),
136-
"reports", "api-diff",
134+
String buildDirectoryPath = project.getRootProject()
135+
.getLayout().getBuildDirectory().getAsFile().get().getAbsolutePath();
136+
Path outDir = Paths.get(buildDirectoryPath, "reports", "api-diff",
137137
baseLineVersion + "_to_" + project.getRootProject().getVersion());
138138
return project.file(outDir.resolve(project.getName() + ".html").toString());
139139
}

settings.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ rootProject.children.each {project ->
4747
settings.gradle.projectsLoaded {
4848
gradleEnterprise {
4949
buildScan {
50-
File buildDir = settings.gradle.rootProject.getLayout().getBuildDirectory().getAsFile().get()
50+
File buildDir = settings.gradle.rootProject
51+
.getLayout().getBuildDirectory().getAsFile().get()
5152
buildDir.mkdirs()
5253
new File(buildDir, "build-scan-uri.txt").text = "(build scan not generated)"
5354
buildScanPublished { scan ->

0 commit comments

Comments
 (0)