ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emanuele Gesuato <emanuelegesu...@virgilio.it>
Subject Splitting "args" in an ant target
Date Sat, 17 Jan 2009 21:36:35 GMT
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-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message