Java's Ant

Posted by Andy Gavin on Fri, 2006-03-10 12:12

I've never really understood why people rave about Ant, for me it only exists because of Java. A cross-platform build tool was needed. I understand this. To illustrate Ant Homepage it they say:

Makefiles are inherently evil as well. Anybody who has worked on them for any time has run into the dreaded tab problem. "Is my command not executing because I have a space in front of my tab!!!" said the original author of Ant way too many times. Tools like Jam took care of this to a great degree, but still have yet another format to use and remember.

Ant is different. Instead of a model where it is extended with shell-based commands, Ant is extended using Java classes. Instead of writing shell commands, the configuration files are XML-based, calling out a target tree where various tasks get executed. Each task is run by an object that implements a particular Task interface.

This to me isn't an advert, and is an indication of the shout-first,listen-later arrogance of some of the software community. Ant is different alright.

Don't get me wrong ANT is useful to string together build commands. But it is pretentious thinking ANT is anything more than a stop-gap tool until something better is written. It's the sort of tool that gets written on a project because you need somthing quick. It you were to design a build tool it wouldn't be ANT. It's a build system for web technologists.

What's wrong with it? For starters it doesn't even improve on what make did well. Which isn't new technology--- make was written in the 70s.
Make started a tradition of defining the build declaratively; I know some of the ANT community insist that ANT is declarative, so control flow statements aren’t needed. ANT isn't declarative any more than java is. Declaritive means that you'd make declarations about the build, and ANT would build it. The nearest ANT gets to this is to call functions (with preconditions) targets.

Make does creak at the seams, but Ant does not solve many of it's shortcomings.

There are alternatives:


Add new comment