ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <anto...@gmx.de>
Subject Re: Empty arguments on the command-line under windows
Date Thu, 01 Sep 2005 05:43:42 GMT
Hello Martin,

Martin Senger wrote:

>My <java> task is (shortened):
>
><java classname="MosesGenerators" taskname="Service(s)"
>   classpathref="moses.build.classpath" fork="true" failonerror="true">
>   <arg value="-cacheDir"/>
>   <arg file="${registry.cache.dir}"/>
>   <arg value="-s"/>
></java>
>
>Before invoking it I set an empty value to ${registry.cache.dir} unless it
>is already set:
>
><condition property="registry.cache.dir" value="">
>   <not><isset property="registry.cache.dir"/></not>
></condition>
>
>  
>
This (condition task invocation) rewrites more simply :

<property name="registry.cache.dir" value=""/>
because ant only assigns a value to unexisting properties.

To solve your Windows problem, you can do :
<property name="registry.cache.dir" value="&quot;&quot;"/>
this might lead Windows to understand that there is an empty argument

Cheers,

Antoine


>If the value is indeed empty, I would expect that my java class gets three
>command-line arguments like this:
>   -cacheDir "" -s
>
>And, indeed, it does - but only under linux. Under windows the empty
>argument disappears:
>   -cacheDir -s
>
>This may be a native way how Windows deals with such situation, so Ant
>cannot do much about it. Could anybody conform this, or advise me how to
>make it work on both OS?
>
>   Thanks you very much for your help,
>   Martin
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message