You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dominique Devienne <DD...@lgc.com> on 2003/04/07 17:34:27 UTC

RE: "destroy"-ing an Ant exec doesn't destroy what Ant is "exec"- ing...

Stefan,

Why can't Main.java be modified to not call System.exit, possibly
conditionally under the control from a new command line argument?

Seems like the simplest and cleanest solution, no?!?!? --DD

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Monday, April 07, 2003 10:31 AM
To: user@ant.apache.org
Subject: Re: "destroy"-ing an Ant exec doesn't destroy what Ant is
"exec"-ing...

On Mon, 07 Apr 2003, Rich Wagner <ri...@hotmail.com> wrote:

> Do you know whether these IDE front ends have to work-around this
> "<java>"/System.exit problem,

Yes, yes they have (NetBeans for sure, as Jesse Tilly keeps bugging us
about it 8-)

> and if so, how ?

by registering a SecurityManager that disallows System.exit.

Re: "destroy"-ing an Ant exec doesn't destroy what Ant is "exec"- ing...

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Stefan Bodewig" <bo...@apache.org>
To: <us...@ant.apache.org>
Sent: Monday, April 07, 2003 08:54
Subject: Re: "destroy"-ing an Ant exec doesn't destroy what Ant is "exec"-
ing...


> On Mon, 7 Apr 2003, Dominique Devienne <DD...@lgc.com> wrote:
>
> > Why can't Main.java be modified to not call System.exit, possibly
> > conditionally under the control from a new command line argument?
>
> Reread Rich's mail.  Ant calling System.exit is not his problem (well,
> at leat not all of it), he's looking for a more general solution.
>
> Main#main has never been intended to be anything but the command line
> entry point into Ant.  Calling System.exit with any argument other
> than 0 on errors is highly appreciated by us Unix users.  This rules
> out removing the System.exit unconditionally.

main calls void start(String args[]), right? maybe it shoud delegate to

void start(String args[]) {
  int result=runAnt(args);
 System.exit(result);
}

and then runAnt or whatever would be the other entry point.


Re: "destroy"-ing an Ant exec doesn't destroy what Ant is "exec"- ing...

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 7 Apr 2003, Dominique Devienne <DD...@lgc.com> wrote:

> Why can't Main.java be modified to not call System.exit, possibly
> conditionally under the control from a new command line argument?

Reread Rich's mail.  Ant calling System.exit is not his problem (well,
at leat not all of it), he's looking for a more general solution.

Main#main has never been intended to be anything but the command line
entry point into Ant.  Calling System.exit with any argument other
than 0 on errors is highly appreciated by us Unix users.  This rules
out removing the System.exit unconditionally.

I'd rather add a new method for non-command line usage that didn't
include a System.exit than making this conditional.  But then again,
we don't really have a nice API for embeddors and we shouldn't even
try to claim we had one (which a separate entry point for embeddors
micht do).

I'd rather like to see us providing a real API for these things, and
thought the Antidote project would push Ant into that direction.  It
didn't and efforts have slowed down.

Stefan