SiB*_*SiB 13
让我们假设您拥有的目标是zip-project
您想要执行的下一个目标next-target-for-something
一种方法是使用 antcall
<target name="zip-project">
<!-- Your Zipping Task-->
<antcall target="next-target-for-something"/>
</target>
Run Code Online (Sandbox Code Playgroud)
记住 antcall
可里面调用 target
只
另一种方法是使用 depends
你会有这样的东西:
<target name="zip-project" >
<!-- Your Zipping Task-->
</target>
Run Code Online (Sandbox Code Playgroud)
现在将下一个任务定义为
<target name="next-target-for-something" depends="zip-project" >
<!-- Your Next Task-->
</target>
Run Code Online (Sandbox Code Playgroud)
虽然这与你所要求的方式相反.所以你需要像蚂蚁一样召唤蚂蚁......
ant -buildfile <build.xml> next-target-for-something
Run Code Online (Sandbox Code Playgroud)
它将确保首先zip-project
完成然后next-target-for-something
将被执行.
希望这可以帮助!!