【发布时间】:2011-10-09 20:14:56
【问题描述】:
我有一个 ant 目标,它接受可变数量的要传递给 exec 任务的参数。使用旧机制很简单:
<exec command="cmd /c ${_full-path-to-exec}" osfamily="windows" failonerror="true">
</exec>
但是,不推荐使用“命令”以支持嵌套元素。像这样:
<exec executable="cmd" osfamily="windows" failonerror="true">
<arg value="/c"/>
<arg file="${_full-path-to-exec}"/>
<arg value="${_param-one}"/>
<arg value="${_param-two}"/>
<arg value="${_param-three}"/>
</exec>
这使得变量参数列表不可能。
如何解决这个问题?
【问题讨论】: