Search in sources :

Example 1 with ValidateTaskProperties

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);
}
Also used : SourceSet(org.gradle.api.tasks.SourceSet) ValidateTaskProperties(org.gradle.plugin.devel.tasks.ValidateTaskProperties) File(java.io.File)

Aggregations

File (java.io.File)1 SourceSet (org.gradle.api.tasks.SourceSet)1 ValidateTaskProperties (org.gradle.plugin.devel.tasks.ValidateTaskProperties)1