I'd say no difference whatsoever, and it's more a personal style issue,
where you want to balance being explicit and/or being concise. The former
approach must just make the static analysis of the dependency graph a
pico-second faster to have fewer dependencies... Your approach seems the
right one about relying on gut feel. But that's just me. --DD

-----Original Message-----
From: Paul Christmann [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 30, 2002 9:27 AM
To: 'Ant Users List'
Subject: Dependency handling (was RE: init target)

>     <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.

I've had several cases where I've wavered back and forth between these
two approaches.  In general, I try to end up with whatever "feels" like
the real dependencies, even if it means repeating dependencies as in the
latter case.  For example, if the t2/t1 dependency is something I could
envision perhaps changing someday (perhaps "t2" is "tests" and "t1" is
"compile" - someday I might want to be able re-run a test without
recompilation), then I'll treat it like the 2nd case.  But if t2
requires t1 which required init, then I'll lean towards the former case.

One minor annoyance with the latter, though: I use an ant2dot.xsl that
was posted on this list back in June(many thanks Stefan!! (and Erik for
the build targets to automate it!!)).  The latter approach really
clutters up the graph.  I end up with two arrows out of t2 and two into
init.  But that's an issue with the stylesheet (and I'm still learning
XSL syntax to see if I can clean that up....)

THanks for any thoughts,

Paul Christmann

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to