Using build Java replaces build XML, using Java and ant libraries as building systems
I've been disappointed with groovy based ant alternatives Ant builder doesn't work in eclipse, eclipse's groovy plug-in is disappointing, and gradle isn't ready yet
The ant document has a section called "using ant tasks outside ant", which provides a trailer on how to use ant libraries in Java code Here is another example:
http://www.mail-archive.com/dev @ant. apache. org/msg16310. html
In theory, use build Java instead of build XML looks simple The ant documentation suggests some undocumented dependencies I'm going to discover (no documentation from the point of view of using ant in Java)
Given the disappointing level of ant scripts, I don't know why I haven't done this before Maybe it has and is not a good build system
Has anyone tried to write a build file in Java using the ant library?
Solution
Our construction system is mainly based on what you described, and its effect is very good We use ant tasks (especially file manipulation tasks) from custom Java programs, which use automatic discovery based on the agreed Application module layout to compose applications
You might need some glue ant XML to compile the build script yourself and actually call java to perform the build, but it's small
Not only is java more readable than ants, especially when it comes to conditional execution, but it's much faster Our ant based build used to take one minute to assemble ear, but now the Java based version takes about five seconds