开发者

How to pass a variable number of arguments to ant exec

I have a ant target that takes a variable number of arguments that are to be passed to an exec task. Using the old mechanism it is trivial:

<exec command="cmd /c ${_full-path-to-exec}" osfamily="windows" failonerror="true">
</exec>

However, use of 'command' is deprecated i开发者_开发知识库n favor of nested elements. like this:

<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>

which makes variable argument lists impossible.

How to solve this problem?


How about this:

 <arg line="whatever args you need"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜