Browse Source

Merge pull request #31416 from GVictorG7

* pr/31416:
  Polish "Replace deprecated method getBuildDir()"
  Replace deprecated method getBuildDir()

Closes gh-31416
pull/31491/head
Stéphane Nicoll 11 months ago
parent
commit
6669ab1ae7
  1. 7
      buildSrc/src/main/java/org/springframework/build/api/ApiDiffPlugin.java
  2. 3
      settings.gradle

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -131,8 +131,9 @@ public class ApiDiffPlugin implements Plugin<Project> { @@ -131,8 +131,9 @@ public class ApiDiffPlugin implements Plugin<Project> {
}
private File getOutputFile(String baseLineVersion, Project project) {
Path outDir = Paths.get(project.getRootProject().getBuildDir().getAbsolutePath(),
"reports", "api-diff",
String buildDirectoryPath = project.getRootProject()
.getLayout().getBuildDirectory().getAsFile().get().getAbsolutePath();
Path outDir = Paths.get(buildDirectoryPath, "reports", "api-diff",
baseLineVersion + "_to_" + project.getRootProject().getVersion());
return project.file(outDir.resolve(project.getName() + ".html").toString());
}

3
settings.gradle

@ -47,7 +47,8 @@ rootProject.children.each {project -> @@ -47,7 +47,8 @@ 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