Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 7319 invoked from network); 16 Dec 2003 16:10:45 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 16 Dec 2003 16:10:45 -0000 Received: (qmail 66886 invoked by uid 500); 16 Dec 2003 16:10:19 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 66846 invoked by uid 500); 16 Dec 2003 16:10:19 -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 66817 invoked from network); 16 Dec 2003 16:10:19 -0000 Received: from unknown (HELO hotmail.com) (64.4.14.192) by daedalus.apache.org with SMTP; 16 Dec 2003 16:10:19 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 16 Dec 2003 08:10:21 -0800 Received: from 146.115.121.128 by law10-oe57.law10.hotmail.com with DAV; Tue, 16 Dec 2003 16:10:21 +0000 X-Originating-IP: [146.115.121.128] X-Originating-Email: [mgainty@hotmail.com] X-Sender: mgainty@hotmail.com From: "Martin Gainty" To: "Ant Users List" , "Evgeny Goldin" References: <184194544860.20031216172214@netvision.net.il> Subject: Re: "If Ant fails, it will return a non-zero exit code" - doesn't hold any more ? Date: Tue, 16 Dec 2003 16:09:41 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: X-OriginalArrivalTime: 16 Dec 2003 16:10:21.0946 (UTC) FILETIME=[1B51EDA0:01C3C3EF] 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 Evgeny Try this (from Perl) my @xsl = ("java", "org.apache.tools.ant.Main.main"); system(@xsl); Regards, Martin ----- Original Message ----- From: "Evgeny Goldin" To: Sent: Tuesday, December 16, 2003 10:22 AM Subject: "If Ant fails, it will return a non-zero exit code" - doesn't hold any more ? > > Hello, > > It's being said on this list that "If Ant fails, it will return a non-zero exit > code". Unfortunately, it doesn't work for me: > > 1) I have a build.xml that fails (see below) > 2) I call 'ant' from Perl script, using 'system()' call and expect to see > a non-zero exit code from ant. > 3) What I see *is* zero. > > Ant v1.5.4, j2se v1.4.2, Windows 2000 > > Here's the code: > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ build.xml ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~ show_exit_code.pl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > use strict; > use warnings; > > ( @ARGV == 1 ) or die "Param: command to run"; > my $command = $ARGV[ 0 ]; > my $exit_code = ( system ( $command ) / 256 ); > print "Exit code of running [$command] is [$exit_code]\n"; > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ > > Running it: > >perl -w show_exit_code.pl ant > Buildfile: build.xml > > compile: > > BUILD FAILED > file:E:/Projects/AntFailure/build.xml:5: AAAAAAAAA > > Total time: 2 seconds > Exit code of running [ant] is [0] > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ > > Running script with something else that fails (to make sure it's not lying) > >perl -w show_exit_code.pl "java Opa" > Exception in thread "main" java.lang.NoClassDefFoundError: Opa > Exit code of running [java Opa] is [1] > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ > > As you may see, the exit code of failing ant project is zero. Can somebody, > please, explain this to me ? > > > > > > > --------------------------------------------------------------------- > 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