ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikas Phonsa <>
Subject Conditional Statement Again
Date Fri, 01 Aug 2003 23:10:52 GMT
I have to perform two tasks ( <cvs> and <manifest>) in one target as

<target name="CvsImport" unless="ifNewJars" description="CVS Import"
			<cvs cvsroot="${cvsRoot}" passfile="${pass.file}">
				<argument value="import"/>
				<argument value="-m"/>
				<argument value="${cvs.msg}"/>
	 <manifest file="${manifest.file}">	    
     <attribute name="Manifest-Version" value="${Manifest-Version}"/>


Now I want that if the <cvs> task fails due to any reason the build should
be stopped and <manifest> task should not be executed. I have tried to use
<cvs failonerror="true">, it does stop the build on error but gives all
sorts of error codes in many lines ( hundreds of red colored lines in my
IDE).I just want it to stop the build and maybe give a single line of error
code and exit.

Any ideas.


-----Original Message-----
From: Stefan Bodewig [] 
Sent: Wednesday, July 30, 2003 11:39 PM
Subject: Re: Conditional Statement

On Wed, 30 Jul 2003, Matt <> 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}"/>
<fail if="they-are-equal">property1 and property2 must not be equal.</fail>


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message