本文介绍了使用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中,您可以使用顺序标签可按顺序运行任务.通常,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按照< include>标记中的顺序读取build.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!