Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 21463 invoked from network); 16 Dec 2005 06:39:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Dec 2005 06:39:44 -0000 Received: (qmail 82621 invoked by uid 500); 16 Dec 2005 06:39:37 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 82499 invoked by uid 500); 16 Dec 2005 06:39:36 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 82465 invoked by uid 99); 16 Dec 2005 06:39:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2005 22:39:36 -0800 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [193.109.238.66] (HELO dnsinet.rzf-nrw.de) (193.109.238.66) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2005 22:39:35 -0800 Received: from z011100.bk.fin.local (z011104.bk.fin.local [172.18.101.140]) by dnsinet.rzf-nrw.de (8.12.10/8.12.10) with ESMTP id jBG6dBfR030548 for ; Fri, 16 Dec 2005 07:39:11 +0100 Received: from z011134.bk.fin.local ([130.11.7.134]) by z011100.bk.fin.local with Microsoft SMTPSVC(6.0.3790.0); Fri, 16 Dec 2005 07:39:11 +0100 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Subject: AW: ant return status Date: Fri, 16 Dec 2005 07:39:11 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ant return status Thread-Index: AcYBxUhPJzmWe3liS5GzNQcRwmtVGQADdUpgAA3oiiA= From: To: X-OriginalArrivalTime: 16 Dec 2005 06:39:11.0859 (UTC) FILETIME=[6CB8E430:01C6020B] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N >> I'm charged with learning more about ant return status variables. I=20 >> have no clue where to start. Links to documentation that=20 >will help me=20 >> understand it would be most welcome. Pointing to specific=20 >sections of=20 >> documentation would be helpful. To clarify my interest: I am=20 >> interested in capturing whether or not ant has successfully=20 >completed=20 >> execution or if there was a failure. > >The ant commandline script under windows (NT/XP/etc.) returns=20 >either 0 or 1. >A zero value indicates that the build was successful. A value=20 >of 1 indicates an error. Under Windows you can use the=20 >ERRORLEVEL variable to test the result of invoking ant. For example: > > CALL :execute-my-ant-build > IF ERRORLEVEL 1 GOTO :exit > > :execute-my-ant-build > PUSHD my-dir\my-subdir > CALL ant %* > POPD > GOTO :EOF > > :exit > IF ERRORLEVEL 1 ECHO WOOPS, SOMETHING FAILED > GOTO :EOF > >Cheers, Steve. If you use you could provide a level for your own using "status" attribute. It=B4s passed to System.exit() which results (on windows) in %ERRORLEVEL%. Jan Example: build.xml ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------= 8-<---- Alles ok ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------= 8-<---- check.bat ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------= 8-<---- @echo off setlocal set arg=3D-Dstatus=3D%1 if "%1"=3D=3D"" set arg=3D call ant %arg% -quiet check if %ERRORLEVEL% gtr 2 goto levelElse goto level%ERRORLEVEL% :level0 echo Suuper goto end :level1 echo na ja goto end :level2 echo hilfe goto end :levelElse echo KATASTROPHE !!! goto end :end endlocal ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------= 8-<---- --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org