ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <>
Subject Re: Dependency handling (was RE: init target)
Date Fri, 30 Aug 2002 14:51:47 GMT
Paul Christmann wrote:
>>    <target name="init"/>
>>    <target name="t1" depends="init"/>
>>    <target name="t2" depends="t1"/>
>  versus 
>>    <target name="init"/>
>>    <target name="t1" depends="init"/>
>>    <target name="t2" depends="init,t1"/>
> Is there actually any difference in the way ant will process these
> dependencies?  They appear to be identical, but the latter case lists
> explicitly that it depends on init (rather than relying on implicit
> dependencies), which implies "init" is on the dependency list twice.  I
> know that Ant will only execute init once, though; I'm just curious if
> there any implicitations (performance, anything else???) that affect one
> approach more than the other.

There is no difference to how Ant will run in the above situations. What I 
try to do is think in terms of what each target produces and what it 
requires. In the above case I would use the first alternative if t2 only 
uses things which are produced in the t1 target whereas I'd uses the second 
alternative if it t2 also uses things produced by init. I'm talking about 
direct relationships, not the transitive dependencies here.

The reason this can be important is when you start to refactor the build. If 
you change t1 so it no longer requires init to run first, will t2 still work?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message