ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Primoz.Pris...@marand.si
Subject RE: Checking existence of property
Date Wed, 23 Oct 2002 10:12:47 GMT

Check your Ant versoin. I use 1.5.1 and it works.

Example from my build file:

<fail if="testFailed"/>


Primoz Prislan.



                                                                                         
                                                    
                    "Leahy,                                                              
                                                    
                    Kevin"               To:     "'Ant Users List'" <ant-user@jakarta.apache.org>
                                            
                    <Kevin.Leahy@        cc:                                          
                                                       
                    drkw.com>            Subject:     RE: Checking existence of property
                                                     
                                                                                         
                                                    
                    23.10.2002                                                           
                                                    
                    12:09                                                                
                                                    
                    Please                                                               
                                                    
                    respond to                                                           
                                                    
                    "Ant Users                                                           
                                                    
                    List"                                                                
                                                    
                                                                                         
                                                    
                                                                                         
                                                    




Primoz,

Have you tried this yourself. I tried that on Monday, but without examples
was unable to get anywhere.

I am trying:

           <target name="checkproperty" depends = "init">
                     <property file="example.properties" />
                     <echo message="property set to ${property.name}" />
                     <fail unless="property.name" />
           </target>

Message I get is that fail does not support tbe unless attribute. Same
story
with the if attribute.

Thanks

Kevin

-----Original Message-----
From: Primoz.Prislan@marand.si [mailto:Primoz.Prislan@marand.si]
Sent: 23 October 2002 10:46
To: Ant Users List
Subject: Re: Checking existence of property



Use Fail task with if/unless attribute.

Prmoz Prislan.





                    "Leahy,

                    Kevin"               To:     "Ant (E-mail)"
<ant-user@jakarta.apache.org>

                    <Kevin.Leahy@        cc:

                    drkw.com>            Subject:     Checking existence of
property


                    23.10.2002

                    11:43

                    Please

                    respond to

                    "Ant Users

                    List"









Hi
I have defined a variable via a properties file.
If the the variable was not set in the properties file I want the build to
fail.
Does anyone know how to do this?
Thanks
Kevin


----------------------------------------------------------------------
If you have received this e-mail in error or wish to read our e-mail
disclaimer statement and monitoring policy, please refer to
http://www.drkw.com/disc/email/ or contact the sender.
----------------------------------------------------------------------


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






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


----------------------------------------------------------------------
If you have received this e-mail in error or wish to read our e-mail
disclaimer statement and monitoring policy, please refer to
http://www.drkw.com/disc/email/ or contact the sender.
----------------------------------------------------------------------


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






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