Re: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-12 Thread Michael Ludwig
Ashley Williams schrieb am 12.06.2009 um 10:56:37 (+0100): > From my personal experience I've always found it to be the case that > it's only a matter of time before the build code not only requires > logic, but also needs to be accessible from the application - strange > as that may sound. Unify

Re: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-12 Thread Steve Loughran
Michael Ludwig wrote: Ashley Williams schrieb am 11.06.2009 um 17:51:45 (+0100): // create the ant parent project Project project = new Project(); project.setName("project"); project.init(); // create the child targ

Re: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-12 Thread Ashley Williams
Michael, You are right what you see is nasty ;) however I deliberately inlined the code for clarity. In practice I actually abstract most of it into helper classes which is really easy to do and you can mostly get away with code like this: new UntarTask(src, dest).execute(); // execute sing

Re: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-11 Thread Michael Ludwig
Ashley Williams schrieb am 11.06.2009 um 17:51:45 (+0100): > > // create the ant parent project > Project project = new Project(); > project.setName("project"); > project.init(); > > // create the child target > T

Re: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-11 Thread Michael Ludwig
Dean Schulze schrieb am 11.06.2009 um 09:48:12 (-0700): > > Ant build scripts make simple things like an if else difficult Use the extensions, as mentioned by others. > and things like changing the value of a property impossible. This might be seen as a feature (but I rather don't think it

Re: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-11 Thread Dale Anson
ll 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 [mailto:dean_w_schu...@yahoo.com] > Sent: Thursday, June 11, 2009 11:28 AM >

Re: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-11 Thread Ashley Williams
Hi Dean, I use this technique frequently as in this example lifted straight from my code, see below. All you have to remember is that a top level project owns many targets which in turn own many tasks, so just make sure you set up the parent/child references in both directions.

RE: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-11 Thread Dean Schulze
: RE: Replacing build.xml with Build.java - 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

RE: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-11 Thread Cole, Derek E
[mailto:dean_w_schu...@yahoo.com] Sent: Thursday, June 11, 2009 11:28 AM To: user@ant.apache.org Subject: Replacing build.xml with Build.java - 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

Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-11 Thread Dean Schulze
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 Build.java. The Ant documentation hints at some undocumented dependencies that I'll have to