Skip to content

Commit dbcf646

Browse files
committed
Create FileCollection templates as early as possible
1 parent 3179ea5 commit dbcf646

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/resources/de/thetaphi/forbiddenapis/gradle/plugin-init.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ project.sourceSets.all{ sourceSet ->
4242
String sourceSetTaskName = sourceSet.getTaskName(FORBIDDEN_APIS_TASK_NAME, null);
4343
def sourceSetTask = TASK_AVOIDANCE_AVAILABLE ? project.tasks.register(sourceSetTaskName, CheckForbiddenApis.class) :
4444
project.tasks.create(sourceSetTaskName, CheckForbiddenApis.class);
45+
def templateClassesDirs = project.files();
46+
def templateClasspath = project.files();
4547
sourceSetTask.configure {
4648
description = "Runs forbidden-apis checks on '${sourceSet.name}' classes.";
4749
dependsOn(sourceSet.output);
@@ -60,9 +62,7 @@ project.sourceSets.all{ sourceSet ->
6062
return extension[key]
6163
})
6264
}
63-
ConfigurableFileCollection templateClassesDirs = project.files();
6465
classesDirs = { templateClassesDirs.from(sourceSet.output.hasProperty('classesDirs') ? sourceSet.output.classesDirs : sourceSet.output.classesDir) }
65-
ConfigurableFileCollection templateClasspath = project.files();
6666
classpath = { templateClasspath.from(sourceSet.compileClasspath) }
6767
targetCompatibility = targetCompatibilityGetter
6868
}

0 commit comments

Comments
 (0)