ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: Detecting <target> failure!
Date Tue, 15 Aug 2006 08:58:45 GMT
 
You're welcome :-)

bye4now, Gilbert

-----Original Message-----
From: timujain [mailto:temujain2000@yahoo.com] 
Sent: Tuesday, August 15, 2006 3:17 AM
To: user@ant.apache.org
Subject: RE: Detecting <target> failure!


Hi Gilbert,

Many many thanks for your clear and easy to follow help! Very much
appreciated.

Thanks,

Timujain  


Rebhan, Gilbert wrote:
> 
> 
> Hi,
> 
> 1. ant-contrib has a <try> ... <catch> task
> 
> see http://ant-contrib.sourceforge.net/tasks/tasks/index.html
> and Logic Tasks / Trycatch
> 
> 2. some tasks f.e. <exec> have a resultproperty /outproperty
> you can check that property with a condition
> 
> <condition property="prop">                                         
>      <equals arg1="${resultproperty}" arg2="0" />
>     	</condition>
>        <fail unless="prop" message="error -- rc != 0 " /> 
> 
> 
> or with ant-contrib if / else / then, example =
> 
> <!-- start ksh script -->     
> <echo>${kshscript.prefix} activate ${projekt} ${lum} ${earfile}</echo>
>          
> <exec executable="${plinkexec}" resultproperty="rc.activate"
> failonerror="false">
> ...
> 
> you have to use failonerror="false" here if you don't want an instant 
> Build failed and handle that error yourself !!
> 
> </exec>
>        
> <!-- ...check RC -->
> <target name="main" depends="depends" >
>        
> <echo>+++ Returncode was_deploy_scm.ksh activate ==> ${rc.activate}
> +++</echo>
> <if>
>    <not>
>        <equals arg1="${rc.activate}" arg2="0" />
>     </not>
>     <then>
>        <echo>+++ RC Shellscript != 0 +++${line.separator}Abbruch :-(
> !!</echo>
>        <fail />
>      </then>
> </if>
> 
> 
> or the depending target checks the property with
> 
> <target name="foo" if="${resultproperty}>
> or
> <target name="foo" unless="${resultproperty}>
> 
> 
> Regards, Gilbert 
> 
> -----Original Message-----
> From: timujain [mailto:temujain2000@yahoo.com] 
> Sent: Friday, August 11, 2006 8:27 AM
> To: user@ant.apache.org
> Subject: Detecting <target> failure!
> 
> 
> Hi there,
> How can I detect <target> or <task> failure to call another <target>
as
> plan
> B rather than failing the entire build?
> -- 

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


Mime
View raw message