You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Gregg Freeman <gr...@brainstormlabs.net> on 2007/12/20 21:23:39 UTC

Duplicate target execution

I'm using Ant 1.7.0 (on Windows Vista) with Java 1.5.0_12.

I'm having a problem where the same target in an ant script gets executed 
multiple times.  Using this tiny script
as an example:

<project name="proj" basedir=".">
  <target name="build">
    <echo message="Building" />
  </target>
  <target name="deploy" depends="build" >
    <echo message="Deploying" />
  </target>
</project>

When I run:
ant build deploy

I get the following output:
Buildfile: testBuild.xml

build:
     [echo] Building

build:
     [echo] Building

deploy:
     [echo] Deploying

BUILD SUCCESSFUL

I thought ant was supposed to take care of duplicate targets.  Is this a bug 
or an intentional change (I always thought
it only executed tasks once).?




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Duplicate target execution

Posted by Chuck Holzwarth <ch...@yahoo.com>.
Your command line is running each target in turn. If you use
ant deploy build

You should see
Building
Deploying
Building

I think the command line you want is
ant deploy


Gregg Freeman <gr...@brainstormlabs.net> wrote: I'm using Ant 1.7.0 (on Windows Vista) with Java 1.5.0_12.

I'm having a problem where the same target in an ant script gets executed 
multiple times.  Using this tiny script
as an example:



  
    
  
  
    
  


When I run:
ant build deploy

I get the following output:
Buildfile: testBuild.xml

build:
     [echo] Building

build:
     [echo] Building

deploy:
     [echo] Deploying

BUILD SUCCESSFUL

I thought ant was supposed to take care of duplicate targets.  Is this a bug 
or an intentional change (I always thought
it only executed tasks once).?




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org





Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.