ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maxime FAZENTIEUX" <m.fazenti...@epro.fr>
Subject loop with ant
Date Tue, 01 Mar 2005 10:46:35 GMT
Hi,
 
I want to execute ant tasks in a loop :
 
The Java class :
 
public class TacheEssai extends Task{
   public void execute() throws BuildException{
      Project projet = this.getProject();
      for(int i=0;i<5;i++){
        projet.setUserProperty("num_tmp",""+i);
        projet.executeTarget("ecrit");
      }
   }
}
 
 
File build.xml :
 
<taskdef name="boucle" classname="tache.ant.TacheEssai" classpath="${path_tache}" />
            
<target name="ecrit">
  <property name="${num_test}" value="${num_tmp}"/>
  <echo message="num_test = ${num_test}"/>
</target>
            
<target name="debut">
  <boucle/>
</target>
            
<target name="test" depends="debut">
  <echo message="Fin exécution"/>
</target>
 
 
PROBLEM : The property num_tmp is always to 0 !
 
How do I can do to change the num_tmp ?
 
Thanks

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message