ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikas Phonsa <VPho...@suz.com>
Subject RE: Conditional Statement
Date Thu, 31 Jul 2003 17:06:57 GMT
You need to use Antelope for that. There was a big discussion on this issue
yesterday. Check that out. You'll find some code and useful ideas too.

Vikas

-----Original Message-----
From: Mehra, Vishal [mailto:vmehra@inovant.com] 
Sent: Thursday, July 31, 2003 9:59 AM
To: 'Ant Users List'
Subject: RE: Conditional Statement

Instead of checking the values of variable/properties, is it possible to do
if/condition on a ant task.

i.e. if ant task fails (like javac) 
	then 
		email_build_failed_target 
	else 
		email_build_success_target.

Thanks,

Vishal

-----Original Message-----
From: Parnell, Giles (AU - Sydney)
[mailto:g.parnell@eclipsegroup.com.au]
Sent: Wednesday, July 30, 2003 11:48 PM
To: 'Ant Users List'
Subject: RE: Conditional Statement


I asked the same question a couple of hours ago.... it appears to be abit of
a topic at the moment.

Heres the answer i got. Seems to work fine.

> Ant-contrib and Antelope both have <if> tasks that do what you want.
> There have been several message regarding these external projects today
> and yesterday.

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Thursday, 31 July 2003 4:39 PM
To: user@ant.apache.org
Subject: Re: Conditional Statement


On Wed, 30 Jul 2003, Matt <mathews_julien@hotmail.com> wrote:

> How do we add "if-else" statements in Ant. I need to compare two
> variables and execute a task if they are not equal and abort with an
> error message if they are equal.

<condition property="they-are-equal">
  <equals arg1="${property1}" arg2="${property2}"/>
</condition>
<fail if="they-are-equal">property1 and property2 must not be equal.</fail>
<perform-your-task/>

Stefan

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


***********Confidentiality/Limited Liability Statement***************

This message contains privileged and confidential information intended
only for the use of the addressee named above.  If you are not the 
intended recipient of this message, you must not disseminate, copy or 
take any action in reliance on it.  If you have received this message 
in error, please notify Deloitte Touche Tohmatsu immediately.  Any 
views expressed in this message are those of the individual sender, 
except where the sender specifically states them to be the views of 
Deloitte.

The liability of Deloitte Touche Tohmatsu, is limited by, and to the 
extent of, the Accountants' Scheme under the Professional Standards 
Act 1994 (NSW).

The sender cannot guarantee that this email or any attachment to it 
is free of computer viruses or other conditions which may damage or
interfere with data, hardware or software with which it might be used.
It is sent on the strict condition that the user carries out and relies
on its own procedures for ensuring that its use will not interfere with
the recipients systems and the recipient assumes all risk of use and
absolves the sender of all responsibility for any consequence of its use.


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

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


Mime
View raw message