can we include any type of loop in the ant build.xml file?

I have to generate one build.xml file that performs the same tasks for various 
modules. Each time i have to add one module or delete one module I have to remove 
targets from the build.xml file or add targets in the build file. Targets have all the 
functionalities same but only the module name changed. If I can add one loop in the 
build.xml file that will repeat the same targets for all the modules then it will 
greatly help me.

Please look at the targets below: both are same but only the name "staff" is replaced 
with "provisioning" in the second target. Can I directly generate these types of 
modules?

<target name="make-staff-jar" if="staff.present">
   <jar jarfile="${appjars.server.dir}/staff-ejb.jar">
     <fileset dir="${build.classes.dir}">
   <include name="**/staff/**/*"/>
        </fileset>
  <fileset dir="${build.ejb-meta.dir}/staff"/>
    </jar>
</target>

<target name="make-provisioning-jar" if="provisioning.present">
   <jar jarfile="${appjars.server.dir}/provisioning-ejb.jar">
     <fileset dir="${build.classes.dir}">
   <include name="**/provisioning/**/*"/>
        </fileset>
  <fileset dir="${build.ejb-meta.dir}/provisioning"/>
    </jar>
</target>

Thanks in advance.

Dhaval

Reply via email to