Skip to content

Commit

Permalink
Read project rootdir within task creation rather than within task action
Browse files Browse the repository at this point in the history
  • Loading branch information
rschattauer committed Oct 30, 2023
1 parent 0775934 commit 8d3121d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ abstract class GenerateReportsTask @Inject constructor(
@get:Optional
internal abstract val baseline: RegularFileProperty

private val rootDir: File = project.rootDir

init {
// Workaround for https://github.com/gradle/gradle/issues/2919
onlyIf {
Expand Down Expand Up @@ -142,7 +144,7 @@ abstract class GenerateReportsTask @Inject constructor(
param.baseline.set(baseline)
param.projectDirectory.set(projectLayout.projectDirectory)
if (relative.get()) {
param.filePathsRelativeTo.set(project.rootDir)
param.filePathsRelativeTo.set(rootDir)
}
}
}
Expand Down

0 comments on commit 8d3121d

Please sign in to comment.