use of org.gradle.plugin.devel.tasks.ValidateTaskProperties in project gradle by gradle.
the class JavaGradlePluginPlugin method configureTaskPropertiesValidation.
private void configureTaskPropertiesValidation(Project project) {
ValidateTaskProperties validator = project.getTasks().create(VALIDATE_TASK_PROPERTIES_TASK_NAME, ValidateTaskProperties.class);
File reportsDir = new File(project.getBuildDir(), "reports");
File validatorReportsDir = new File(reportsDir, "task-properties");
validator.setOutputFile(new File(validatorReportsDir, "report.txt"));
SourceSet mainSourceSet = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
validator.setClasspath(mainSourceSet.getCompileClasspath());
validator.setClassesDir(mainSourceSet.getOutput().getClassesDir());
validator.dependsOn(mainSourceSet.getOutput());
project.getTasks().getByName(JavaBasePlugin.CHECK_TASK_NAME).dependsOn(validator);
}
Aggregations