public void apply(Project project) {
project.getPlugins().apply(ReportingBasePlugin.class);
project.getConvention().getPlugins().put("projectReports", new ProjectReportsPluginConvention(project));
TaskReportTask taskReportTask = project.getTasks().add(TASK_REPORT, TaskReportTask.class);
taskReportTask.setDescription("Generates a report about your tasks.");
taskReportTask.conventionMapping("outputFile", new ConventionValue() {
public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
return new File(convention.getPlugin(ProjectReportsPluginConvention.class).getProjectReportDir(), "tasks.txt");
}
});
taskReportTask.conventionMapping("projects", new ConventionValue() {
public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
return convention.getPlugin(ProjectReportsPluginConvention.class).getProjects();
}
});