ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Alth" <OA...@de.ibm.com>
Subject Problems in fail task
Date Tue, 15 Apr 2003 07:37:14 GMT
Hello,

I am trying to fail my build if a property is not set in the build file.
But it doesn't work.
Here's my code

<!-- Main target, will be executed by default -->
<target name="main">

<available property="env" file="c:/forrest/bin/forrest.bat"/>

<echo> Variable ${env} </echo>
<fail message="Environment not properly configured."
        unless="${env}"/>

</target>


Ant outputs:
So the property is true and set, so why does the build fail? I think it
should be successful.



C:\WSAD_WORKSPACE\docubuilder>ant
Buildfile: build.xml

main:
     [echo]  Variable true

BUILD FAILED
file:C:/WSAD_WORKSPACE/docubuilder/build.xml:49: Environment not properly
config
ured.

Total time: 1 second



Thanks,


Oliver



__________________________________________________________________
IBM Deutschland Entwicklung GmbH, Schönaicher Str. 220, D-71032 Böblingen
eServer Software Management, D4357, Intern: 7103-06, Tel. 902-2790,
Tel.: ++49-(0)7031-16-4280, Fax.: 07031-16-2790
Internet: OALTH@DE.IBM.COM


Mime
View raw message