Please note that
mustRunAfterandshouldRunAfterare marked as "incubating" (as of Gradle 3.0) which means that these are experimental features and their behavior can be changed in future releases.
There are two ordering rules available:
mustRunAftershouldRunAfterWhen you use the mustRunAfter ordering rule you specify that taskB must always run after taskA, whenever both taskA and taskB will be run.
The shouldRunAfter ordering rule is similar but less strict as it will be ignored in two situations:
shouldRunAfter task, then this task will be run regardless of whether its shouldRunAfter dependencies have been run or not.