ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Kee" <ke...@netsco.com>
Subject RE: Newbie question
Date Thu, 03 May 2001 02:45:48 GMT
Hi Stefan:
   How do you find docs about all these special features like unless, if,
fail, etc, etc? I searched high and low in the manual at jakarta.apache.org
for some description but cannot find any mention about these feature.

Thanks
keith

> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@apache.org]
> Sent: Wednesday, May 02, 2001 3:39 AM
> To: ant-user@jakarta.apache.org
> Subject: Re: Newbie question
>
>
> Robert Leftwich <digital@ix.net.au> wrote:
>
> > b) Fail the build if JAVA_HOME or ant.java.version is not correct -
> > but the only way I can find to do that is to write a script
> > (javascript/netrexx/etc) that checks the value and adds a target (or
> > enables a target) that does the fail - this seems overly complex.
>
> You can get away without scripting.
>
> <target name="check-version">
>   <available property="jdk1.3+" classname="java.lang.StrictMath" />
> </target>
>
> <target name="ensure-1.3" depends="check-version" unless="jdk1.3+">
>   <fail>Can only build if running in a JDK 1.3 VM</fail>
> </target>
>
> and make all your targets depend on the ensure-1.3 target
>
> Stefan
>
>


Mime
View raw message