使用ant iterate-projects跳过项目

时间:2009-06-23 14:47:22

标签: ant

我们有一个包含这个位的ant构建脚本:

<target name="test">
  <antcall target="iterate-projects">
    <param name="test-depends" value="false" /> 
    <param name="target" value="test" />
  </antcall>
</target>

我想跳过测试我们的一些项目,因为它们非常大并且包含第三方测试。像

这样的东西
if (library.name().startsWith("lucene"))
  continue

我如何在蚂蚁中实现这个?

2 个答案:

答案 0 :(得分:0)

您可以使用这种技术:

<target name="lucene" unless="skip_test">
...
</target>

要跳过目标,您必须定义属性

<target name="test">
  <property name="skip_test" value="true"/>
  <antcall target="iterate-projects">
    <param name="test-depends" value="false" /> 
    <param name="target" value="test" />
  </antcall>
</target>

答案 1 :(得分:0)

Ant Contrib项目包含有用但粗略的控制流任务,包括<if>。你可以将它与库中的其他任务串起来,以达到你需要的帽子。