ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murali Vemulapalli" <mur...@wakesoft.com>
Subject How do I iterate thorugh a directory and subdirectories looking for build.xml scripts and execute them
Date Thu, 11 Oct 2001 22:30:51 GMT

Hello ! 

I am building automated test scripts using ANT. I have a 
directory hierarchy which contains a driver ANT script. 
In a particular target, I need to look into all the subdirectories 
looking for build.xml files and run them with default targets. 
I know how to get all the build.xml scripts, like 

<fileset dir="${test.dir}"> 
   <include name="**/build.xml"/> 
</fileset> 


But how do I iterate through this list getting the directory for 
each and run ant script there. My target for running build script
look like

<target name="build-a-testcase" 
        description="build a test case"
        depends="prepare">
    <ant antfile="build.xml"
         dir="${src.testcase.dir}" 
         target="dist"
         inheritAll="false">
    </ant>

</target>  

Please note that the ${src.testcase.dir} differs for each testcase
and it is the parent directory of the file build.xml

I have looked into ForEach custom task floating around the user
group. But I wasn't sure how I can use it for this example.

Is it for character strings only are for filesets also.
How do I use it to get the parent directory for each iterated
file.

Any suggestions, code examples are greatly appreciated. 
Thanks a bunch in advance, 

-- 
Murali


Mime
View raw message