You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Holliday, Donald B. (LNG-CSP)" <Do...@lexisnexis.com> on 2004/02/07 00:38:38 UTC
Conditionally setting property values
I have ant build scripts that need to run on both Win2K and Solaris. The
JDK/SDKs, JREs, and locally constructed jar files are in different
directories, depending on the operating system.
I want to write a script that says something like
<if os.arch="windows" >
set a bunch of properties
</if>
<if os.arch="unix" >
set the same properties, only to different values
</if>
<condition> provides "if" like properties, but I can't see how this allows
me to set many properties to different values based on one condition test.
Is there an easy way to do this? If there is, what is it?
Thanks,
Donald Holliday
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Conditionally setting property values
Posted by Steven Scheffler <st...@scheffler.us>.
You can achieve the below by using the ant-contrib package. Go here
(http://ant-contrib.sourceforge.net/) to download.
Using the <if> task you can express the if/then/else type logic you're
looking for.
-----Original Message-----
From: Holliday, Donald B. (LNG-CSP) [mailto:Donald.Holliday@lexisnexis.com]
Sent: Friday, February 06, 2004 5:39 PM
To: 'Ant Users List'
Subject: Conditionally setting property values
I have ant build scripts that need to run on both Win2K and Solaris. The
JDK/SDKs, JREs, and locally constructed jar files are in different
directories, depending on the operating system.
I want to write a script that says something like
<if os.arch="windows" >
set a bunch of properties
</if>
<if os.arch="unix" >
set the same properties, only to different values
</if>
<condition> provides "if" like properties, but I can't see how this allows
me to set many properties to different values based on one condition test.
Is there an easy way to do this? If there is, what is it?
Thanks,
Donald Holliday
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org