Skip to content

Commit

Permalink
replace deprecated projectDir and buildDir
Browse files Browse the repository at this point in the history
also fix the resolution of relative output directories: for the
Multiplatform-test it failed because it resolved the path to
":android/my/path"
  • Loading branch information
balrok committed Apr 23, 2024
1 parent 0784c9a commit 06cc42a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ licenseReport {
// Set output directory for the report data.
// Defaults to ${project.buildDir}/reports/dependency-license.
outputDir = "$projectDir/build/licenses"
outputDir = project.layout.buildDirectory.dir("licenses").get().asFile.path
// Select projects to examine for dependencies.
// Defaults to current project and all its subprojects
Expand Down Expand Up @@ -84,7 +84,7 @@ licenseReport {
// This is for the allowed-licenses-file in checkLicense Task
// Accepts File, URL or String path to local or remote file
allowedLicensesFile = new File("$projectDir/config/allowed-licenses.json")
allowedLicensesFile = project.layout.projectDirectory.file("config/allowed-licenses.json").asFile
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LicenseReportExtension {

LicenseReportExtension(Project project) {
unionParentPomLicenses = true
outputDir = "${project.buildDir}/reports/dependency-license"
outputDir = project.layout.buildDirectory.dir("/reports/dependency-license").get().asFile.absolutePath
projects = [project] + project.subprojects
renderers = new SimpleHtmlReportRenderer()
configurations =
Expand Down Expand Up @@ -77,7 +77,7 @@ class LicenseReportExtension {
if (new File(outputDir).isAbsolute()) {
return outputDir
} else {
return projects.first().absoluteProjectPath(outputDir)
return projects.first().layout.projectDirectory.dir(outputDir).asFile.absolutePath
}
}

Expand Down

0 comments on commit 06cc42a

Please sign in to comment.