ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Gemis <marc.gemis...@belgium.agfa.com>
Subject Re: conditional compilation 2
Date Fri, 21 Jun 2002 10:14:06 GMT
On 6/21/02 12:05 PM, "Dmitry Trunikov" <tda@quasarlabs.com> wrote:

> 
>   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.
> 

<target name="init">
    <condition property="linux_and_windows">
        <and>
            <isset property="LINUX" />
                <!-- you could also use <equals arg1="LINUX" arg2="1"> -->
            <isset property="WINDOWS" />
        </and>
    </condition>
    <fail message="Either LINUX or WINDOWS, not both" if="linux_and_windows"
/>
</target>

m.


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


Mime
View raw message