You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the default compilation tasks for the main and test sourceSets are enhanced for Java, Kotlin, and Groovy following a strict name matching convention i.e these tasks are matched
compileJava
compileKotlin
compileGroovy
compileTestJava
compileTestKotlin
compileTestGroovy
It’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 each SourceSet as they point to the compile tasks that affect said sourceSet.
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:
Only specific tasks get enriched. For example compileJava belonging to the main SourceSet but not compileDemoJava belonging to the demo SourceSet.
Task search is performed eagerly, some tasks may fail to be found if the 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.gradleThe text was updated successfully, but these errors were encountered: