ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
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>

  <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

=====
(holtdl@yahoo.com)



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

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message