ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manickam Periyarsamy Nithyanadam Vignesh <>
Subject RE: One question about ANT
Date Tue, 25 Mar 2003 13:54:28 GMT
	Find out this in

Ant tries to execute the targets in the depends attribute in the order they
appear (from left to right). Keep in mind that it is possible that a target
can get executed earlier when an earlier target depends on it:

<target name="A"/>
<target name="B" depends="A"/>
<target name="C" depends="B"/>
<target name="D" depends="C,B,A"/>
Suppose we want to execute target D. From its depends attribute, you might
think that first target C, then B and then A is executed. Wrong! C depends
on B, and B depends on A, so first A is executed, then B, then C, and
finally D.

A target gets executed only once, even when more than one target depends on
it (see the previous example).


-----Original Message-----
From: Ponce Albendea, Javier []
Sent: Tuesday, March 25, 2003 7:19 PM
Subject: One question about ANT

Hi all,

This is my build.xml
I'm trying to re-use a task, as if it was a function,

This is part of my build.xml 

  <target name="funcionVssCreate" description="Crea el directorio
especificado como 'parametro'">  
      <vsscreate login      ="${login}" 
                 vssPath    ="${pathInicio}/${vssDirNuevo}" 
                 serverPath ="${serverPath}" 
                 ssDir      ="${ssDir}" 
                 failOnError="${vssCreate_failOnError}" /> 
  <target name="paramsDirectorioProyecto">
	  <property name="vssDirNuevo" value="${nombreProyectoMayus}" />
  <target name="paramsDirectorio_ant">
	  <property name="vssDirNuevo" value="${nombreProyectoMayus}/ant" />
  <target name="crearDirectorioProyecto" depends="paramsDirectorioProyecto,
funcionVssCreate"> </target>
  <target name="crearDirectorio_ant"     depends="paramsDirectorio_ant,
funcionVssCreate"> </target>
  <target name="creaProyecto"            depends="crearDirectorioProyecto,
crearDirectorio_ant"> </target>

As you can see, i've got a task funcionVsscreate that creates a folder. 
The folder comes determinated by the vssDirNuevo variable. This variable
is defined by the tasks paramsDirectorioProyecto,  paramsDirectorio.
I've got also tasks like crearDirectorioProyecto and crearDirectorio_ant
to create the respective folders.

But, when the task creaProyecto is executed, by the depends policy 
comes the following:
    paramsDirectorioProyecto -> funcionVssCreate -> crearDirectorioProyecto
-> paramsDirectorio_ant ->
    funcionVssCreate -> crearDirectorio_ant -> creaProyecto 
The task funcionVssCreate teorically must be executed twice, but it's
executed just once.
It looks like a determinated task (in this case, creaProyecto) keeps a list
of the tasks
that has executed, and when one of the task that it's been executed before,
has to be executed 
again, it does not.
Is that correctly??
Is there any target parameter that enables (forces) the tasks repeated to be
executed more than once??

Thanks in advance

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

The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in


View raw message