You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ja...@vodafone-us.com on 2002/04/23 00:19:10 UTC

can a target be used twice in a target

I'm try to use a target more than once, but it doesn't seem to run the
second time

eg.

<!-- jar: compile src files, and package into jar file -->
     <target name="jar" depends="cleanup, compile, package, cleanup"/>

the cleanup, deletes all the files in the classes directory. I want to this
before and after, since some of my build processes don't cleanup. and
before checking in,

thanks
jane
_____________________
Jane Fraser
Release Manager
Core Platform Engineering

x 6743
cell 415-517-0168


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: can a target be used twice in a target

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 22 Apr 2002, Jane Fraser <Ja...@vodafone-us.com> wrote:

> I'm try to use a target more than once, but it doesn't seem to run
> the second time

If it is part of the dependency graph for a target, each target will
be run at most once - so it doesn't change anything if you put the
name of a target into depends more than once.

If you are sure that you really want to do what your target definition
suggests,

<target name="jar" depends="cleanup, compile, package">
  <antcall target="cleanup" />
</target>

would do the trick.

But I'd suggest rethinking your design, why does your jar target
guarantee that cleanup has been run after it has finished.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>