Summary: | [PATCH] enable <depends target=""/> tag inside targets | ||
---|---|---|---|
Product: | Ant | Reporter: | Nicola Ken Barozzi <nicolaken> |
Component: | Core | Assignee: | Ant Notifications List <notifications> |
Status: | NEW --- | ||
Severity: | enhancement | Keywords: | PatchAvailable |
Priority: | P3 | ||
Version: | 1.7.0 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: | depends.zip; contains the files that were changed and a new Depends.java class |
Description
Nicola Ken Barozzi
2002-09-04 11:46:45 UTC
Created attachment 2913 [details]
depends.zip; contains the files that were changed and a new Depends.java class
What is the use case? I'm not sure why this would be a good thing. It would seem to make the dependency graph no longer obvious. In the example shown, the output of "test-after" is misleadingly asssociated with the "c" target. The use case is that of syntax sugar. Instead of using it, one could simply split the target in many pieces and add dependencies on those, but this many times makes the build really hard to read and maintain. In this case it's simple: <target name="test2" depends="pre1, pre2, c, testafter"> <echo message="test-before"/> </target> <target name="testafter"> <echo message="test-after"/> </target> So users use <antcall> for it, with the associated new-project overhead etc. Taken from Myrmidon http://ant.apache.org/myrmidon/differences.html " As well as the depends attribute of the Target there is a new <depends> task that allows you to evaluate dependencies inside a target just like executing a normal task. This change was made as previously users have tried to achieve this behaviour by using antcall. However you had to add if attributes to the common targets to make sure that they were not evaluated multiple times. This was difficult and error prone. Building it into the tool helps directly supports this usecase." As for the misleading target association, it's a bug 8-) |