开发者

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:

  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 ?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜