Replacing build.xml with Build.java - using Java and the Ant libraries as a build system

Posted by Dean Schulze on Stack Overflow See other posts from Stack Overflow or by Dean Schulze
Published on 2009-06-09T21:19:55Z Indexed on 2010/03/08 8:51 UTC
Read the original article Hit count: 804

Filed under:
|
|
|

I've grown disillusioned with Groovy based alternatives to Ant. AntBuilder doesn't work from within Eclipse, the Groovy plugin for Eclipse is disappointing, and Gradle just isn't ready yet.

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. There's another example here:

http://www.mail-archive.com/[email protected]/msg16310.html

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 discover (undocumented from the point of view of using Ant from within Java).

Given the level of disappointment with Ant scripting, I wonder why this hasn't been done before. Perhaps it has and isn't a good build system.

Has anyone tried writing build files in Java using the Ant libraries?

© Stack Overflow or respective owner

Related posts about build-automation

Related posts about build-tools