ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Meakin" <>
Subject RE: conditional compilation 2
Date Fri, 21 Jun 2002 10:13:12 GMT
One simple way to do it is:

<task name="check_conditions">
<condition property="both_os" value="true"><and><equals arg1="LINUX"
arg2="1"/><equals arg1="WINDOWS" arg2="1"/></and></condition>

<task name="fail_on_both_os" if="both_os">
  <fail message="Bad arguments- Both LINUX and WINDOWS are set"/>

<task name="starthere" depends="check_conditions,fail_on_both_os">
  do stuff

However there are better ways to do what you're doing. Check out the
property for example.


-----Original Message-----
From: Dmitry Trunikov []
Sent: 21 June 2002 11:02 AM
Subject: conditional compilation 2

    Hi ALL!
I checked mail archive but didn't find answer for my question.
My problem is following. I have java application that is built by ant.
Application is OS depended therefore I pass target  OS as build
property: ant -DLINUX=1 or ant -DWINDOWS=1. I would like to add to
build.xml some code that can does validation of input properties for
mutual exclusion,  i.e. command for build: ant -DLINUX=1 -DWINDOWS=1 is
not valid.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message