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();
}
});
PropertyReportTask propertyReportTask = project.getTasks().add(PROPERTY_REPORT, PropertyReportTask.class);
propertyReportTask.setDescription("Generates a report about your properties.");
propertyReportTask.conventionMapping("outputFile", new ConventionValue() {
public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
return new File(convention.getPlugin(ProjectReportsPluginConvention.class).getProjectReportDir(), "properties.txt");
}
});
propertyReportTask.conventionMapping("projects", new ConventionValue() {
public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
return convention.getPlugin(ProjectReportsPluginConvention.class).getProjects();
}
});
DependencyReportTask dependencyReportTask = project.getTasks().add(DEPENDENCY_REPORT,
DependencyReportTask.class);
dependencyReportTask.setDescription("Generates a report about your library dependencies.");
dependencyReportTask.conventionMapping("outputFile", new ConventionValue() {
public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
return new File(convention.getPlugin(ProjectReportsPluginConvention.class).getProjectReportDir(), "dependencies.txt");
}
});
dependencyReportTask.conventionMapping("projects", new ConventionValue() {
public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
return convention.getPlugin(ProjectReportsPluginConvention.class).getProjects();
}
});