You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Currimbhoy Shahyan <sh...@siemens.com> on 2005/08/05 20:03:15 UTC

Exec task does not fail inspite of non-zero error level

Hi,
 
I am using an ant script to trigger off my builds and unit tests but for
some reason I am unable to get the exec task to work properly.
My ant script contains the following code snippet:
<!-- Build component -->

<target name="build" depends="init">

<exec executable="${root}/BUILDLOCAL.CMD" failonerror="true"

output="${output.dir}/build.txt">

</exec>

</target>

 

All my BUILDLOCAL.CMD does is set ERRORLEVEL=50.

This should cause my build task to fail however for some reason my build
executes successfully.

Could you tell me what I am doing wrong. I was under the impression that
failonerror=true should cause a failure if errorlevel is non-zero.

 

Thanks in advance,

Shahyan.

 



-------------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions 
USA, Inc. and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding, printing, 
copying, distributing, or using such information is strictly prohibited and may 
be unlawful.  If you received this message in error, or have reason to believe 
you are not authorized to receive it, please promptly delete this message and 
notify the sender by e-mail with a copy to Central.SecurityOffice@shs.siemens.com 

Thank you

Re: Exec task does not fail inspite of non-zero error level

Posted by "David A. Bartmess" <di...@edingo.net>.
I may be entirely wrong, been a while, but I think you need to 
"return 50" or "exit 50" to get the error code returned to ant...

At 12:03 PM 8/5/2005, you wrote:

>Hi,
>
>I am using an ant script to trigger off my builds and unit tests but for
>some reason I am unable to get the exec task to work properly.
>My ant script contains the following code snippet:
><!-- Build component -->
>
><target name="build" depends="init">
>
><exec executable="${root}/BUILDLOCAL.CMD" failonerror="true"
>
>output="${output.dir}/build.txt">
>
></exec>
>
></target>
>
>
>
>All my BUILDLOCAL.CMD does is set ERRORLEVEL=50.
>
>This should cause my build task to fail however for some reason my build
>executes successfully.
>
>Could you tell me what I am doing wrong. I was under the impression that
>failonerror=true should cause a failure if errorlevel is non-zero.
>
>
>
>Thanks in advance,
>
>Shahyan.
>
>
>
>
>
>-------------------------------------------------------------------------------
>This message and any included attachments are from Siemens Medical Solutions
>USA, Inc. and are intended only for the addressee(s).
>The information contained herein may include trade secrets or privileged or
>otherwise confidential information.  Unauthorized review, 
>forwarding, printing,
>copying, distributing, or using such information is strictly 
>prohibited and may
>be unlawful.  If you received this message in error, or have reason 
>to believe
>you are not authorized to receive it, please promptly delete this message and
>notify the sender by e-mail with a copy to 
>Central.SecurityOffice@shs.siemens.com
>
>Thank you

---------------------------
David A. Bartmess
Software Configuration Manager
http://edingo.net
---
jSyncManager Open Source PDA Sync Program
Developer
http://jsyncmanager.org



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


Re: Exec task does not fail inspite of non-zero error level

Posted by Matt Benson <gu...@yahoo.com>.
Try:

EXIT 50

-Matt

--- Currimbhoy Shahyan
<sh...@siemens.com> wrote:

> 
> Hi,
>  
> I am using an ant script to trigger off my builds
> and unit tests but for
> some reason I am unable to get the exec task to work
> properly.
> My ant script contains the following code snippet:
> <!-- Build component -->
> 
> <target name="build" depends="init">
> 
> <exec executable="${root}/BUILDLOCAL.CMD"
> failonerror="true"
> 
> output="${output.dir}/build.txt">
> 
> </exec>
> 
> </target>
> 
>  
> 
> All my BUILDLOCAL.CMD does is set ERRORLEVEL=50.
> 
> This should cause my build task to fail however for
> some reason my build
> executes successfully.
> 
> Could you tell me what I am doing wrong. I was under
> the impression that
> failonerror=true should cause a failure if
> errorlevel is non-zero.
> 
>  
> 
> Thanks in advance,
> 
> Shahyan.
> 
>  
> 
> 
> 
>
-------------------------------------------------------------------------------
> This message and any included attachments are from
> Siemens Medical Solutions 
> USA, Inc. and are intended only for the
> addressee(s).  
> The information contained herein may include trade
> secrets or privileged or 
> otherwise confidential information.  Unauthorized
> review, forwarding, printing, 
> copying, distributing, or using such information is
> strictly prohibited and may 
> be unlawful.  If you received this message in error,
> or have reason to believe 
> you are not authorized to receive it, please
> promptly delete this message and 
> notify the sender by e-mail with a copy to
> Central.SecurityOffice@shs.siemens.com 
> 
> Thank you



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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