ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Possible new task
Date Tue, 23 Apr 2002 15:35:35 GMT
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 name="doit">
    <echo message="Do some tasks..."/>
    <do target="t1"/>
    <do target="t2"/>

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

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

$ ant
     [echo] Do some tasks...

     [echo] Running common...

     [echo] Running t1...

     [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



Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more

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

View raw message