}
@TaskAction
public void generate() {
try {
ReportRenderer renderer = getRenderer();
File outputFile = getOutputFile();
if (outputFile != null) {
renderer.setOutputFile(outputFile);
} else {
renderer.setOutput(getServices().get(StyledTextOutputFactory.class).create(getClass()));
}
Set<Project> projects = new TreeSet<Project>(getProjects());
for (Project project : projects) {
renderer.startProject(project);
generate(project);
renderer.completeProject(project);
}
renderer.complete();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}