What about the <condition> property? That can be used to check the OS.

<condition property="parameters"
    value="Windows Parameters"
    else="Unix Parameters">
    <os family="windows"/>
</condition>

 <java classname="com.MyClass"  fork="yes" dir="..">
   <classpath>
       <path refid="java.class.path"/>
   </classpath>
   <arg line="${parameters}" />
 </java>

On Sat, Jan 17, 2009 at 4:36 PM, Emanuele Gesuato
<emanuelegesu...@virgilio.it> wrote:
> Hi there,
>
> In a my ant script, i've a target similar to the following:
>
> <target name="run-class"  description="Executes Warp." >
>  <java classname="com.MyClass"  fork="yes" dir="..">
>    <classpath>
>        <path refid="java.class.path"/>
>    </classpath>
>    <arg value="c"/>
>    <arg line="/C ${app.creator}"/>
>    <arg line="${app.name}"/>
>    <arg value="${app.package}"/>
>  </java>
> </target>
>
>
> I would like to add an "arg" only in specific cases based on the operating
> system in which the script is running.
>
> So, i think to "group" the several arg lines outside the target in a way
> similar to the following:
>
> <args id="myargs">
>    <arg value="c"/>
>    <arg line="/C ${app.creator}"/>
>    <arg line="${app.name}"/>
>    <arg value="${app.package}"/>
> </args>
>
> <target name="run-class"  description="Executes Warp." >
>  <java classname="com.MyClass"  fork="yes" dir="..">
>    <classpath>
>        <path refid="java.class.path"/>
>    </classpath>
>    <arg refid="myargs" />
>  </java>
> </target>
>
>
> Is it possible ? Which task should i use ?
>
> Or are there more polite ways to accomplish this ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>



-- 
--
David Weintraub
qazw...@gmail.com

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

Reply via email to