Ant for other ant's
I have several projects, most of them has "test" target, which run tests and store results in property 'test.faulire'.
All projects located in same directory:
- big_project / someproject1
- big_project / someproject1 / build.xml
- big_project / someproject2
- big_project / someproject2 / build.xml
So, in root of 'big_project' i want to create one build.xml for:
Running test on all projects
If 开发者_开发百科all test ok, run "deploy" task on each project. It'll be very well if I could pass some deployment parameters to each project.
How would you realize this scenario ?
You might have a look at the for task in ant-contrib. With it you could iterate over all directories like that:
<for param="dir">
<path>
<dirset dir="." includes="*"/>
</path>
<sequential>
<ant dir="${dir}" antfile="${dir}/build.xml" target="aTarget" />
</sequential>
</for>
Have a look at the Ant manual page on the 'subant' task. The page contains examples on how to use the task the way you want to.
精彩评论