使用ant按照< include>标记中的顺序读取build.xml [英] using ant read the build.xml ,according to the order written in <include >tag

查看:83
本文介绍了使用ant按照< include>标记中的顺序读取build.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我想先由蚂蚁编译/运行ExceuteLeadTest.class,然后再编译ExceuteContactTest.class.但是在执行时,它首先合并/运行ExcecuteContactTest.java/ExceuteContactTest.class

Here i want to compile/run first ExceuteLeadTest.class and then ExceuteContactTest.class by the ant ..But while exceuting it first it comipling/running ExcecuteContactTest.java/ExceuteContactTest.class

<project>
<target name="run" depends="compile">
<include name="testScript/ExceuteLeadTest.class" />
<include name="testScript/ExceuteContactTest.class" />
</target>
<project>

推荐答案

在Ant中,您可以使用

In Ant you can use the sequential tag to run tasks in order. Normally Ant processes dependencies and runs each only once if they are included repeatedly in depends.

示例

<target name="run" depends="compile">
    <sequential>
        <antcall target="run1"/>
        <antcall target="run2"/>
    </sequential>
</target>

<target name="run1" depends="compile">
    <!-- however you run the 1st class -->
</target>

<target name="run2" depends="compile">
    <!-- however you run the 2nd class -->
</target>

这篇关于使用ant按照&lt; include&gt;标记中的顺序读取build.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆