[GRADLE-3031] Regression in task dependency graph in 1.7+ that breaks -x flag. Created: 24/Feb/14 Updated: 25/Feb/14 Resolved: 25/Feb/14 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 1.12-rc-1 |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Luke Daley |
Resolution: | Fixed | Votes: | 1 |
Description |
Some of our developers noticed that once they upgrade to Gradle 1.7 or higher they could no longer exclude the test task from executing. This doesn't happen in the vanilla Java plugin, but it surfaces due to a test results aggregation task we place in one of our plugins. After a lot of digging, here's what I've found. Take a sample build, such as this: *settings.gradle* include 'sub' *build.gradle* allprojects { task aggregateTest project(':sub') { check.dependsOn test Running it against Gradle 1.6 gives you this: C:\Temp\exclude-example>gradlew build -x test BUILD SUCCESSFUL Total time: 0.877 secs Running it against Gradle 1.7 or higher gives you this: (note the test task executing) C:\Temp\exclude-example>gradlew build -x test BUILD SUCCESSFUL Total time: 1.615 secs I bisected through all of the changes between 1.6 and 1.7 and got to [this commit]([1]https://github.com/gradle/gradle/comm...) that touched the task graph during the implementation of finalizers. I'm not very familiar with that part of the codebase, so I can't really parse out what specifically is the issue. I added some logging statements to TaskInfo in a Gradle built from that commit to get a better picture of what is happening. Here's that same sample build I used above with the logging statements printing. Note, that :sub:test is first marked required, then not required, and back to required. Seems to be a symptom of excluding a task that has two others that depend on it and are included in the graph. C:\Temp\exclude-example>gradlew build -x test BUILD SUCCESSFUL Total time: 2.02 secs Can anyone familiar with the task graph help debug/patch this? |