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

问题描述

在这里我想先编译/运行 ExceuteLeadTest.class,然后是 ExceuteContactTest.class 蚂蚁..

<目标名称=运行"依赖=编译"><include name="testScript/ExceuteLeadTest.class"/><include name="testScript/ExceuteContactTest.class"/></目标>

解决方案

在 Ant 中你可以使用 sequential 标签按顺序运行任务.通常,Ant 会处理依赖项,并且如果依赖项重复包含在依赖项中,则每个依赖项只运行一次.

示例

<顺序><antcall target="run1"/><antcall target="run2"/></顺序></目标><目标名称="run1"depends="compile"><!-- 不管你如何运行第一堂课--></目标><目标名称="run2"depends="compile"><!-- 但是你运行的是第二堂课--></目标>

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>

解决方案

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.

Example

<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读取build.xml,按照&lt;include&gt;tag中写的顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 05:24