Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use Ant resource tools for this.</p> <pre><code>&lt;property name="arg_list" value="foo bar hello world"/&gt; &lt;resources id="arguments"&gt; &lt;mappedresources&gt; &lt;string value="${arg_list}" /&gt; &lt;filtermapper&gt; &lt;replacestring from=" " to=" -j "/&gt; &lt;/filtermapper&gt; &lt;/mappedresources&gt; &lt;/resources&gt; &lt;property name="arguments" value="-j ${toString:arguments}" /&gt; </code></pre> <p>The above will result in property <code>arguments</code> having the value <code>-j foo -j bar -j hello -j world</code>, which can then be used in the <code>exec</code> <code>arg</code> line.</p> <p>Alternatively a <a href="http://ant.apache.org/manual/Tasks/pathconvert.html" rel="nofollow"><code>pathconvert</code> task</a> can help in this regard:</p> <pre><code>&lt;property name="arg_list" value="foo bar hello world"/&gt; &lt;pathconvert property="arguments" pathsep=" "&gt; &lt;chainedmapper&gt; &lt;flattenmapper /&gt; &lt;regexpmapper from="(.*)" to="-j \1" /&gt; &lt;/chainedmapper&gt; &lt;filelist files="${arg_list}" /&gt; &lt;/pathconvert&gt; </code></pre> <p>If you have absolute paths, rather than just strings in the list, then remove the <code>flattenmapper</code>.</p> <p>If you have relative paths, replace the <code>flattenmapper</code> line with:</p> <pre><code>&lt;globmapper from="${basedir}/*" to="*" /&gt; </code></pre> <p>to prevent the paths being converted to absolute.</p> <p>In the event that you have UNIX-like paths in the arg_list on a Windows system the default settings for pathconvert won't work - the paths get converted to Windows style. Instead, to process the list use:</p> <pre><code>&lt;pathconvert property="arguments" pathsep=" " targetos="unix"&gt; &lt;chainedmapper&gt; &lt;regexpmapper from="C:(.*)" to="-j \1" /&gt; &lt;/chainedmapper&gt; &lt;filelist files="${arg_list}" /&gt; &lt;/pathconvert&gt; </code></pre> <p>Note the <code>targetos</code> setting and the revised regexmapper from argument.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload