Reputation: 1199
I have next structure for my project:
Root
|- A
|- C (depends on A)
\- B (depends on A)
For all of sub-projects we use own plugin for generate-resources: https://github.com/terma/gradle-sqlj-plugin/blob/master/src/main/groovy/org/github/terma/sqljgradleplugin/SqljPlugin.groovy the task from plugin doesn't depend on any however JavaCompile task depends on it
When I build my project in build log I see:
:A:myPluginTask
:B:myPluginTask
:C:myPluginTask
:A:compileJava
:A:processResources
:A:classes
:B // next normal build way
Question why Gradle execute my plugin task for all sub-projects before java tasks? And why it execute java tasks in normal way first all java tasks for A than B ...?
Optional question how Gradle build task execution tree, separated for each project or cross projects?
Thx a lot.
Upvotes: 0
Views: 262
Reputation: 123920
All that can be said (and relied upon) is that Gradle will choose a task order that satisfies the declared task relationships (dependsOn
, mustRunAfter
, shouldRunAfter
, finalizedBy
). All execution dependencies are between tasks (not projects), and it's common that tasks belonging to different projects will get executed in alternation (or in parallel if --parallel
is used). There is a single task execution graph for the whole build.
Upvotes: 2