This issue of running targets via <antcall> that have 'depends' set to the
same target(s) has come up a number of times. The usual workaround
suggestion is to have the common dependency(s) set a "<targetname>.done"
property and include an "unless" on it, but this isn't really a very
elegant solution. Mark McMillan has donated a <do> task, which allows you
to run other targets without re-running the common dependency(s) for each
called target. For example:
  <target name="common">
    <echo message="Running common..."/>
  </target>

  <target name="doit">
    <echo message="Do some tasks..."/>
    <do target="t1"/>
    <do target="t2"/>
  </target>

  <target name="t1" depends="common">
    <echo message="In t1..."/>
  </target>

  <target name="t2" depends="common">
    <echo message="In t2..."/>
  </target>

$ ant
doit:
     [echo] Do some tasks...

common:
     [echo] Running common...

t1:
     [echo] Running t1...

t2:
     [echo] Running t2...

I think this would be a useful task. The code is small, straightforward,
and wouldn't be likely to add any significant maintenance problems. Any
objections?

Diane

=====
([EMAIL PROTECTED])



__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

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

Reply via email to