Open aalmiray opened 5 years ago
This change is bigger than I thought as pretty much all tasks enriched by the plugin are found by name. This behavior poses 2 big problems:
compileJava
belonging to the main
SourceSet but not compileDemoJava
belonging to the demo
SourceSet. modules
plugin is applied before others. This breaks the push Gradle has been doing in the past year to move most behavior to lazy evaluation.In short, it'd be better if APIs such as project.task.withType(TaskType.class, { task -> })
be used instead as
I agree. It should also be possible to attach a listener to ensure any tasks created after the plugin is initialised also get detected as well. Happy to accept a PR.
Currently the default compilation tasks for the
main
andtest
sourceSets are enhanced for Java, Kotlin, and Groovy following a strict name matching convention i.e these tasks are matchedIt’d be great if additional compile tasks were enhanced too. This will likely require matching tasks by type (
CompileJava
for example). Another option is to inspect the properties of eachSourceSet
as they point to the compile tasks that affect said sourceSet.This feature is needed by the GroovyFX project as it declares an extra sourceSet named
demo
https://github.com/groovyfx-project/groovyfx/blob/master/gradle/demo.gradle