ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: "destroy"-ing an Ant exec doesn't destroy what Ant is "exec"- ing...
Date Mon, 07 Apr 2003 16:05:14 GMT
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 <DDevienne@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

Mime
View raw message