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 18:05:14 UTC

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

This makes sense. Thanks for the precisions. I was leaning to making
System.exit conditional just because Ant doesn't provide a clean
programmatic entry point, and one has to almost fully duplicate Main.java to
setup Ant.

What I think is needed is making o.a.t.a.Main a Bean, and refactor the
command line parsing code to call the setters and adders of Main.

This would have two advantages:
1) Obviously people embedding Ant would have a clean entry point, and could
expose all or part of Ant features.
2) By enabling (using Jelly or ideally using Ant itself) to write an XML
script that configures Ant, replacing the command line and ANT_OPTS.

I think this second feature would be very appreciated to all those people
using listener/loggers. It would also be the ideal place to allow overriding
Ant's defaults (like FileSet's default exclude list). Ant's Main class would
thus be configured just like any other task. It could even be the place to
allow some templating of build script using XSL.

I've talked about this before, but it didn't raise much interest last time.
What do people think about this? Thanks, --DD

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Monday, April 07, 2003 10:55 AM
To: user@ant.apache.org
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.

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

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:

> What I think is needed is making o.a.t.a.Main a Bean, and refactor
> the command line parsing code to call the setters and adders of
> Main.

I thought this one of the goals of Costin's embed proposal 8-)

> I've talked about this before, but it didn't raise much interest
> last time.

It may have been lost in the noise, it's probably a good idea to
retry, but you may want to change the subject line (and maybe even the
list).

Stefan