问题
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>
回答1:
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>
来源:https://stackoverflow.com/questions/50202602/using-ant-read-the-build-xml-according-to-the-order-written-in-include-tag