on 7/28/00 7:02 PM, [EMAIL PROTECTED] at [EMAIL PROTECTED] 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. <sigh> 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
