views:

40

answers:

2

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:

  1. Running test on all projects

  2. 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 ?

A: 

Have a look at Ant's manual page on the 'subant' task. The page contains examples on how to use the task the way you want to.

f3lix
A: 

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>
akr