ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Adelöw <Johan.Ade...@corustechnologies.com>
Subject RE: Problem with fail task
Date Tue, 18 Nov 2003 12:51:04 GMT
Sorry I found it it should be 
<fail message="${TEXT1} DIR ${TEXT2}" unless="DIR"/>
Instead of 
<fail message="${TEXT1} DIR ${TEXT2}" unless="${DIR}"/>

/Johan

-----Original Message-----
From: Johan Adelöw 
Sent: den 18 november 2003 13:47
To: ant-user@jakarta.apache.org
Subject: Problem with fail task

Hi

I'm having problem with the fail task. I've written a piece of code that I
thought would fail if the property wasn't set and otherwise just pass.

The fail task fails though the property DIR is set. (I've added an echo to
make it show) 

I'm using Ant 1.5. 

Any suggestions ?

 

My target:

 

            <target name= "test_properties">

                <property name="TEXT1" value="The property"/>

                <property name="TEXT2" value="is not set please check the
properties file"/>

                <echo message=" DIR: ${ DIR}"/>

                <fail message="${TEXT1} DIR ${TEXT2}" unless="${DIR}"/>

            </target>

 

Result:

 

test_properties:

     [echo] DIR: C:/tmp/version/3_1_0

 

BUILD FAILED

file:C:/tmp/version/3_1_0/inst/test_properties.xml:28: The property DIR is

 not set please check the properties file



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


Mime
View raw message