I think that would be very confusing at this point. For better or worse, Ant was designed from the beginning to build its dependencies through backwards chaining. It is often (usually) surprising behaviour to the first time user, but once learned quickly becomes second nature. Introducing a new construct that does the reverse seems likely only to cause massive confusion, especially one with such a similar name.

The fact that often an init method is the lowest level dependency and sets many of the properties used in "if" and "unless" attributes higher in the dependency tree is, I think, a good way to introduce people to the Ant way of designing builds as lists of target dependencies.

Besides, as Jesse points out, there is a very simple workaround.

Antoine Levy Lambert wrote:
Hi,

the current discussion about target groups reminds me that there is something else that I would need in ant.

Currently, when a build file contains this :

<target name="foo" depends="bar" if="someproperty"/>

When executing foo, bar will get executed regardless of whether someproperty is set or not.

I would often see the need for another variation of if, which would remove bar from the dependency tree if someproperty is not set.

Since obviously, it is something else, maybe this should have another attribute name such as "deep-if"

<target name="foo" depends="bar" deep-if="someproperty"/>


I have never thought about how this could be implemented and how much work it is. It is probably a non-trivial addition because it means that the list of targets to execute and their order will change dynamically during the build depending upon how properties evaluate at run time.

Regards,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to