[GRADLE-1626] Task dependency fail for external scripts Created: 20/Jun/11 Updated: 04/Jan/13 Resolved: 21/Jun/11 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 0.9.2 |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Max Garmash | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 0 |
Description |
--- -------------------- - task taskY << { println 'taskY' }------------------- Results: gradle -b ./test.gradle testExt BUILD SUCCESSFUL Total time: 5.654 secs ------------------------------ gradle -b ./test.gradle taskX BUILD SUCCESSFUL |
Comments |
Comment by Szczepan Faber [ 21/Jun/11 ] |
Hey, task.execute() method only executes the 'actions' associated with the task. Actions are attached to task for example via .doLast {} or shorthand notation << {}. task.execute() bypasses task graph calculation, resolving task dependencies, etc. So by design, the task.execute() does not consider task dependencies. Basically, executing tasks in an imperative fashion is against the spirit of gradle. Check out the mailing list about threads on that matter (e.g. task order, executing tasks explicitly). The correct way of solving your problem should be: task testExt {
apply from: 'external.gradle'
dependsOn taskX
}
Hope that helps! |