ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Anson <>
Subject Re: Replacing build.xml with - Doing Ant builds directly from Java
Date Thu, 11 Jun 2009 17:13:30 GMT
For if/else, try/catch, and changing the value of a property, all you
need is either antcontrib ( or antelope
( tasks.


On Thu, Jun 11, 2009 at 10:48 AM, Dean Schulze<> wrote:
> I anticipate using a simple build.xml with different targets to kick off the
file passing in whatever parameters correspond to different targets.  The heavy lifting would
be done by the  build.xml would be used for parameter passing and for integration
with Eclipse.
> Ant build scripts make simple things like an if .... else difficult and things like changing
the value of a property impossible.  Simple things can be done in xml I only anticipate using
build.xml to invoke the
> --- On Thu, 6/11/09, Cole, Derek E <> wrote:
> From: Cole, Derek E <>
> Subject: RE: Replacing build.xml with - Doing Ant builds directly from Java
> To: "Ant Users List" <>
> Date: Thursday, June 11, 2009, 9:41 AM
> You are correct that there is very little documentation on the subject, other than a
few small, simple examples on the net.  It seemed like one of the responders in that link
you posted was implying that he spoofed the tasks he needed to use? That seems like quite
a bit more work than would be necessary. When I have used ant from java, it was primarily
to control dependencies, but I still had underlying build.xml files that individual targets
were called from, using the java program to control when, handle errors, etc.
> Derek
> -----Original Message-----
> From: Dean Schulze []
> Sent: Thursday, June 11, 2009 11:28 AM
> To:
> Subject: Replacing build.xml with - Doing Ant builds directly from Java
> The Ant documentation has a section titled "Using Ant Tasks Outside
> of Ant" which gives a teaser for how to use the Ant libraries from Java
> code.  In theory it seems simple enough to replace build.xml with
> The Ant documentation hints at some undocumented
> dependencies that I'll have to discover (undocumented from the point of
> view of using Ant from within Java).
> Using Java instead of xml to do an Ant build seems so obvious I wonder why there hasn't
been a parallel track over the years for as well as build.xml.
> I asked this same question over at
> The answers indicate that it isn't difficult to do, but that it is necessary to "spoof"
the project and target objects.
> While it all looks encouraging I haven't seen any actual examples of how to deal with
the undocumented issues mentioned.  Has anyone documented how to do Ant builds from Java?
> Thanks.
> Dean
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message