[GRADLE-1610] no exception when task with the same name is added Created: 14/Jun/11 Updated: 04/Jan/13 Resolved: 22/Jun/11 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.0-milestone-3 |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Szczepan Faber | Assignee: | Unassigned |
Resolution: | Not A Bug | Votes: | 0 |
Description |
Issue leads to very confusing behavior, see ticket: |
Comments |
Comment by Szczepan Faber [ 14/Jun/11 ] |
Consider the example: project(':api') { task foo << { println 'yo!' } } task main main.dependsOn task(':api:foo') Actual: Expected:
main.dependsOn ':api:foo'
|
Comment by Adam Murdoch [ 21/Jun/11 ] |
You're not adding the same task twice. The parameter to task() is interpreted as a task name, not a task path. So the call to task(':api:foo') in the root project adds a task with name ':api:foo' to the root project, ie it's adding task '::api:foo', not ':api:foo'. Instead, task() should either fail when a path is passed to it, or should treat its parameter as a path and add the task to the appropriate project. Either way, then you'd get an exception in the above case. |
Comment by Szczepan Faber [ 22/Jun/11 ] |
We should fix |