[英]Execution of ant file within exec task
我想以並行執行以及正在執行的任務的方式運行我的ant即build.xml文件。 我正在使用Exec任務來實現這一目標。 即我正在使用ant在Exec任務中運行build.xml文件,但遇到以下錯誤:錯誤:exec不支持嵌套的“ ant”元素。
我的代碼摘錄是:
<if>
<istrue value="${parallel.exec}" />
<then>
<!-- Parallel execution of task -->
<mkdir dir="${buildroot.dir}/product/${build-log.dir}" />
<exec dir="../../apollo" executable="/bin/sh" spawn="true">
<ant antfile="${buildroot.dir}/product/abs-build.xml" />
</exec>
</then>
我們將<exec>
完全不支持將任意任務作為嵌套元素,就像手冊頁中列出的那樣。
為了運行Ant,您可以使用類似
<exec dir="../../apollo" executable="/bin/sh" spawn="true">
<arg value="${ant.home}/bin/ant"/>
<arg value="-f"/>
<arg file="${buildroot.dir}/product/abs-build.xml" />
</exec>
您可以嘗試創建一個這樣的目標
<target name="antcaller">
<ant antfile="yourantfile" target="do something" />
...
然后可以叫它
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.