ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@gmx.de>
Subject Re: Conditions
Date Tue, 22 Mar 2005 22:20:13 GMT
If you do not use ant-contrib, you have to have 2 targets when something is
dependent upon a condition
<target name="setcondition">
   <condition property="some.flag">
       <!-- fill with your condition here --->
   </condition>
</target>
<target name="doit" depends="setcondition" if="some.flag">
  <!-- here is the real task such as mail --->
</target>

> So I'm trying to execute the mail task based on a conditional statement.
> I'm not sure if I'm doing this incorrectly or not. Basically, what I
> want out of this target is to send an email if the value of a property
> in my props file is true (yes it is in fact in my props file and my
> props file is referenced in my XML file :-) ) If I set
> "release_candidate=true" in my props file, it sends the email, if it's
> set to false, it sends the email. I think it's user error on my part in
> understanding how the condition task is used. Any help is appreciated.
> 
>  
> 
> Here's my code:
> 
>  
> 
> <target name="release">
> 
> <condition property="${release_candidate}">
> 
> <istrue value="true"/>
> 
> </condition>
> 
> <mail mailhost="mail.XXXX.com" subject="The ${component} release
> candidate build is now available!">
> 
>   <from address=" xxxx@xxxx.com"/>
> 
>   <replyto address="xxxx@xxxx.com"/>
> 
>   <to address="xxxx@xxxx.com"/>
> 
>   <message>
> 
> The ${component} release candidate build is now available!
> 
> </message>
> 
> </mail>
> 
> </target>
> 
>  
> 
>  
> 
> Thx
> 
> -Rich
> 
>  
> 
> _____________________________________
> 
> Rich Harris
> 
> Release/Configuration Engineer
> 
> 

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


Mime
View raw message