Skip to content

Commit

Permalink
Move report location computation out of 'configureEach'
Browse files Browse the repository at this point in the history
  • Loading branch information
jjohannes committed Feb 16, 2024
1 parent 66f5337 commit 37c736e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void execute(Task task) {

private void configureJGivenReportDefaults(Project project) {
project.getTasks()
.withType(JGivenReportTask.class).forEach(reportTask ->
.withType(JGivenReportTask.class).configureEach(reportTask ->
reportTask.getReports().all((Action<Report>) report ->
report.getRequired().convention(report.getName().equals(JGivenHtmlReportImpl.NAME))
));
Expand All @@ -90,9 +90,11 @@ private void configureDefaultReportTask(final Test test, JGivenReportTask report

reportTask.getResults().set(getResultsDirectory);

String relativeFilePath = "jgiven" + "/" + test.getName() + "/";
Provider<Directory> reportOutputLocation = reportingExtension.getBaseDirectory().dir(relativeFilePath);

reportTask.getReports().configureEach(report -> {
String relativeFilePath = "jgiven" + "/" + test.getName() + "/" + report.getName();
report.getOutputLocation().set(reportingExtension.getBaseDirectory().dir(relativeFilePath));
report.getOutputLocation().set(reportOutputLocation.map(d -> d.dir(report.getName())));
});
}
}

0 comments on commit 37c736e

Please sign in to comment.