Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 73728 invoked from network); 28 Oct 2003 19:59:52 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 28 Oct 2003 19:59:52 -0000 Received: (qmail 77284 invoked by uid 500); 28 Oct 2003 19:59:33 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 77252 invoked by uid 500); 28 Oct 2003 19:59:32 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 77239 invoked from network); 28 Oct 2003 19:59:32 -0000 Received: from unknown (HELO empburexch.burlington.emptoris.com) (63.111.224.162) by daedalus.apache.org with SMTP; 28 Oct 2003 19:59:32 -0000 Received: by empburexch.burlington.emptoris.com with Internet Mail Service (5.5.2653.19) id ; Tue, 28 Oct 2003 14:56:06 -0500 Message-ID: <15717BB71A5CD411A01600508BDCC2E2021C1784@empburexch.burlington.emptoris.com> From: "Ciramella, EJ" To: 'Ant Users List' Subject: RE: Return code from Ant Date: Tue, 28 Oct 2003 14:56:06 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C39D8D.8647D530" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C39D8D.8647D530 Content-Type: text/plain; charset="iso-8859-1" Depending on how badly you want to capture the error code, you can change the ant.bat file: :runAnt "%_JAVACMD%" %ANT_OPTS% -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS% if "%errorlevel%"=="0" goto end :auto-mail if /I not "%AUTOBUILD%"=="true" goto end echo FAILURE!!!! d: cd \auto-home-mail call auto-notify.bat goto end This is the code I have added to send notification to my cell phone if a build fails... -----Original Message----- From: Weiqi Gao [mailto:weiqigao@networkusa.net] Sent: Tuesday, October 28, 2003 1:50 PM To: Ant Users List Subject: Re: Return code from Ant Jing Xue wrote: > Quoting Stefan Bodewig : > > > On 27 Oct 2003, Weiqi Gao wrote: > > > > > > > However in my testing I discovered that Ant's return code is always > > > 0 > > > > Not in my case: > > [snipped] > > > This is Linux, /bin/sh is bash. > > > > Not that it'd be directly helpful to the OP, just wanted to confirm that it > returns error codes on Windows as well: > > c:\work\build>%ant_home%\bin\ant clean > Buildfile: build.xml > > clean: > [delete] Deleting directory c:\work\build\classes > > BUILD SUCCESSFUL > Total time: 1 second > c:\work\build>echo %ERRORLEVEL% > 0 > > c:\work\build>%ant_home%\bin\ant invalid-target > Buildfile: build.xml > > BUILD FAILED > Target `invalid-target' does not exist in this project. > > Total time: 0 seconds > c:\work\build>echo %ERRORLEVEL% Upon close inspection, the error comes out of the stcheckout (StarTeam Checkout) task, not from the delete task. Sorry for the confusion. -- Weiqi Gao weiqigao@networkusa.net http://www.weiqigao.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org ------_=_NextPart_001_01C39D8D.8647D530--