Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 94268 invoked from network); 2 Aug 2000 23:39:28 -0000 Received: from w002.z208176150.sjc-ca.dsl.cnc.net (HELO mail.x180.com) (208.176.150.2) by locus.apache.org with SMTP; 2 Aug 2000 23:39:28 -0000 Received: from [192.168.254.13] ([208.176.176.73]) by mail.x180.com (Netscape Messaging Server 4.15) with ESMTP id FYOUUT00.E3X for ; Wed, 2 Aug 2000 16:35:17 -0700 User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Wed, 02 Aug 2000 16:37:10 -0700 Subject: Re: [RFE] Default Help target on error ? From: James Duncan Davidson To: Message-ID: In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N on 7/28/00 7:02 PM, mpfoemme@ThoughtWorks.com at mpfoemme@ThoughtWorks.com wrote: > The alternative to this is to not catch the exception at all, which means > you'll get a stack trace for every error, which can be annoying. Or we can > catch the exception and ignore it, which means that ant will always return > an error code of zero, and external scripts won't be able to tell if the > build succeeded or not. (Does anyone know why sun didn't have main() simply > return an int?) Returning an int would have been beautiful. The Exceptions should always be caught and return code sent for typically command line use -- you are correct there. > To call Ant from another program you should be able to just call new > Main(args).runBuild(), but right now the constructor for Main is protected. Right.. I guess you could make a .jxe (I think they are called?) that trapped the command "ant" and called this directly. In fact that might be the way to go on JShell. I see that Patrick has submitted some patches and that might take care of things as well. Haven't looked at them yet though. > As for JShell, I thought it implemented its own security manager to trap > calls to System.exit() and handle them. Which version are you using? Whatever was on Patrick's site a month or two back. I admit I haven't played with it much, just a little bit. .duncan