Skip to content

Commit

Permalink
fix configuration cache problem with reports (#54)
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Schmid <service@aaschmid.de>
  • Loading branch information
aaschmid committed Mar 27, 2021
1 parent 76c419e commit bfe0311
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/de/aaschmid/gradle/plugins/cpd/CpdPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ private void setupTaskDefaults(Project project, CpdExtension extension) {
extensionMapping.map("reportsDir", () -> project.getExtensions().getByType(ReportingExtension.class).file("cpd"));

task.getReports().all(report -> {
ConventionMapping reportMapping = ((IConventionAware) report).getConventionMapping();
reportMapping.map("enabled", () -> "xml".equals(report.getName()));
reportMapping.map("destination", () -> new File(extension.getReportsDir(), task.getName() + "." + report.getName()));
report.getRequired().convention("xml".equals(report.getName()));
report.getOutputLocation().convention(project.getLayout().getProjectDirectory().file(project.provider(() ->
new File(extension.getReportsDir(), task.getName() + "." + report.getName()).getAbsolutePath())));
});
});
}
Expand Down

0 comments on commit bfe0311

Please sign in to comment.