ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject Re: Calling Ant from Java: An example please ?
Date Thu, 14 Feb 2002 01:39:01 GMT

----- Original Message -----
From: "Jay Riddell" <>
To: "Ant Users List" <>; "Conor MacNeill"
Sent: Wednesday, February 13, 2002 16:16
Subject: Re: Calling Ant from Java: An example please ?

> Thank you all that have responded. . . but I still need help ;-)
> Of all the response so far, the most relevant of which has been
> "Conor MacNeill" <> who quoted some
> of Ant's testcases.  However, I'd rather not implement it where
> it requires the use of an build.xml file.  Reasons?
>     - speed
>     - need for inclusion of an XML parser in my final distribution.
> Rather, I would like an ALL JAVA, ALL SOURCE CODE, NO EXTRA JAR solution.
> What this means is that I *REALLY* want to figure out how to use the ANT
> API to run the Javac task.
> Any help in THAT direction would be much appreciated.

Well, I think if you want to use ant you have to relax your 'no XML parser
rule'. Ant provides an invocation model for container apps which uses an XML
file as the description language for containers so that the containers are
decoupled from a lot of the implementation details. People have changed how
<javac> works in the past, quite radically, and nobody has noticed in their
build files because of the use of a declarative syntax.

If all you want is to use the java compiler, look at how ant calls it in its
tasks, cut and paste the code. You will need tools.jar on the classpath, of


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message