ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikas Phonsa <VPho...@suz.com>
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
follows:

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

	</manifest>	   
	</target>	




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.

Vikas



-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Wednesday, July 30, 2003 11: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

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


Mime
View raw message