Antmerge

Software Available Here

News

Antmerge is large deprecated now.

The original project which gave rise to Antmerge (MyGrid) has largely moved onto other things, as have I. Moreover, I think that tools such as maven have advanced to the point that Antmerge doesn't really have a role any more. I've left these pages up for informational purposes.

I'm still quite proud of Antmerge. It was a highly useful tool which achieved a lot with a relatively small code base. It's even better that there isn't that much requirement for it before. Using Ant was pretty evil at one stage. It's good that the world has moved forward!

Description

Ant is a build tool. Its written in Java, and uses an XML syntax for its build files. It's become a defacto standard for building Java, and other applications. It's supposed to be like make but without the wrinkles.

Ant works well, and does indeed lack some of make's wrinkles. Its very easy to write a simple build file in ant. However it adds more wrinkles of its own. The most obvious one is that it separates out rules and targets. Within the build file its not as extensible as ant. You have to write Java "tasks" to extend it. The other main problem is that ant build files appear to be very inconsistent. You have to put the right tags in the write place. And sometimes you can not do exactly what you want. Say you have a list of files but you need a fileset. The task you want not having exactly the correct facilities that you need it very common. And the lack of consistency also means that writing ant build files is hard work.

All of this is made worse because ant lacks the more mature tool set, like autoconf. So you end up writing the same, or similar build file again, and again.

There are several solutions to this problem. First you can delegate most of the functionality to a third party utility build file. This works, but if you have many targets you have to write a lot of delegates. Which is error prone and painful. Or you can use one of the project tools such as maven or centipede.

All of these approaches, however, are relatively heavy weight. They require quite a lot of buy in, and its something new to learn. Antmerge takes a different approach. It provides something like inheritance between build files. You write you main build once, and then you override bits of it for the specific project you are working on. This works by generating the main build.xml file by merging the "super class" file with the project specific file. The main advantage of this is that you are still writing simple ant build files. The normal editing tools that you use will work, as both the super class and project specific files are valid ant files. And IDE integration will, again, still work, because the end project is a build.xml file which is just a normal ant file. Finally once you have generated the build.xml file, it will work stand-alone. You do not need antmerge for it to run. So you can still distribute a source version, that will build, without having to install antmerge.

Additionally antmerge comes with a standard set of super class files, which provide basic functionality for build projects, which you can choose to use if you wish. By using these, for example, you can specify an project build like so...

<project name="myproject" default="compile">

  <property name="antmerge.parent" value="default"/>
  <property name="antmerge.infile" value="myproject-in.xml"/>

</project>

This will give you compile, tar/zip, javadoc, clean targets and so on. Other parental files provide test support, tomcat service support, and netbeans module support.

Antmerge was developed by Phillip Lord (p.lord@russet.org.uk) and Nick Sharman (n.sharman@cs.man.ac.uk) as part of the myGrid project. It is currently used by this project to provide build support for many of the 10 or so sub-projects within this project, and has simplfied the task of developing consistent builds considerably. It's not a commercial product, but it has had lots of use, and testing within this environment. It is freely available under the LGPL license, and is available for download now.

A mailing list for discussion of antmerge is available from sourceforge.


Disclaimer: This is my personal website, and represents my opinion. My formal pages and those of the school and university are linked above.