我有一个ant目标,它接受一些可传递给exec任务的可变参数.使用旧机制它是微不足道的:
<exec command="cmd /c ${_full-path-to-exec}" osfamily="windows" failonerror="true">
</exec>
Run Code Online (Sandbox Code Playgroud)
但是,不推荐使用'command'来支持嵌套元素.像这样:
<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>
Run Code Online (Sandbox Code Playgroud)
这使得变量参数列表不可能.
如何解决这个问题呢?
归档时间: |
|
查看次数: |
4500 次 |
最近记录: |