Which is better: The Java ApacheAnt tool or the Unix MakeProgram? ''[Editing Note: Most of this discussion was originally written on the ApacheAnt page.]'' ---- I highly recommend avoiding '''Ant'''. It lacks the basic ability of '''make''' to work with other tools well, in particular to work with tools for computing dependencies. That is where much of the value of make lies: without it, make is just another automation/scripting tool, like Ant - and Ant isn't as good a scripting tool as a scripting language. I've worked with, and come to love, many build systems; Ant is the worst I've ever seen. Its documentation is substandard, its code abysmally inefficient in places, and its failure to even match make in functionality is not good. The worst thing about Ant is the need to define a new "task" for each other tool with which you wish to integrate: make uses the Unix toolbox philosophy, but Ant thinks of itself as the centre of the universe. Dependency management and difficult integration with other tools are the two main reasons why Ant is worse than any other solution in this domain. -- JamesDennett Wow. Worse than any other tool in this domain? Geez, you should see the piece of junk I wrote to automate builds. Seriously, readers should consider James's opinion as about as negative as you can get. (And some of it is incorrect, e.g., his lack of awareness of the exec task). In James's world, Unix is the center of the universe. For those of us not developing under Unix, getting the average makefile to run under any other platform is rarely worth the effort. A correctly written build.xml should run as well under Windows as it does under Unix. -- KellyDenehy ''The lack of dependency checking in Ant is somewhat made up for by dependency checking in Java compilers. If you've got non-Java sources in your project, you'd probably have to use make as well as (or perhaps instead of) Ant. It'd be fair to say that Ant's feature-set is Java-centric. -- AlexValdez'' Ant is doing quite a good job at dependency checking for Java when you use the depend task; work for tasks that wrap C/C++ compilers, including dependency computation for these languages, is on the way (http://sourceforge.net/projects/ant-contrib/). Oh, you certainly don't need to write tasks of your own to integrate with other tools. If you can do it in make by using an external command, you can do it with Ant's exec task as well. ''I have to concur with the recommendation to avoid Ant at any and all costs. Ant's dependency tracking is singularly verbose, error-prone, and impossible to automate in any meaningful way. With, at least, GNU Make, I can express a set of dependencies using environment variables, and use macros and %-substitutions to synthesize a wide variety of other dep-chains from that single, master list. Nothing, so far as I am aware, comes close to this in Ant. As a result, '''massive''' violations of OnceAndOnlyOnce result. It often gets so bad that engineers choose to disregard Ant's ability to properly track dependencies entirely, resorting to flat, ordered lists of projects to be iterated via the '''foreach''' construct, leaving the programmer to decide where to insert new projects or modules. --SamuelFalvo'' ---- If ''make'' is bad because of its human unfriendly syntax, ''Ant'' is worse. Why has no-one written a proper/simple build tool yet? Weird. ''I think you'd get a lot of disagreement on that from those who've used both. I can't remember what $< means in a makefile, but most of the XML tags used in Ant build files are relatively intuitive. And there are some pretty nice XML editing tools out there that hide the complexity from you, like Pollo - http://pollo.sourceforge.net/ - which includes built-in support for Ant. -- KellyDenehy'' I'm sorry, Kelly, but you're dead wrong on this one. I have the most unfortunate privilege of having to maintain Maven, Ant, plain makefiles, and GNU Autotools input files in my current professional capacity. Out of all of these, for as horrid as Autotools is, I cannot express emphatically enough how I prefer dealing with Autotools ''far and above'' having to deal with Ant. --SamuelFalvo ---- Why is ''Ant'' so popular? Build tools are fundamentally expert systems that enable developers to express dependencies between targets and resources. At build time, these tools determine an appropriate ordering to construct the desired target(s). Old-school tools such as ''make'' and ''cook'' provide developers with the ability to concisely express complex rules. Based purely on the fundamentals of a build tool, Ant is currently the weakest major competitor. Since the fundamentals have been better expressed in other tools, I pushed on to find the 'compelling' reason to use Ant. With a little help from ant.apache.org and the Java development with Ant book, I have come up with the following 'compelling' reasons to use Ant: * Ant's configuration files are XML-based. This is bad. XML is verbose and difficult to read and is therefore not an expressive way to represent dependency rules. * Ant is extended using Java classes. Traditionally, one would extend using a scripting language that would allow for a quick turnaround and a declarative result. With a Java class, you get neither. * Ant solves the dreaded make tab problem. I shudder to think there are armies of developers who actually consider a product, given this caliber of argument. * Ant is simpler to learn and maintain. I agree that Ant is simpler to learn, but since it is more verbose and less powerful, I have found that in the two years that I have used Ant that it is significantly more costly and frustrating to maintain. * Ant is cross-platform. Now I finally agree with something. In most of my projects, all developers use Linux and Solaris. So we do not have cross-platform issues. When we do we will consider Ant (or even better, we could use CygWin). * Ant is quicker. This is completely wrong. The single java vm advantage is easily outweighed by the ability to better express rules between dependencies, thereby ensuring that the least amount of work is done to construct a target. No, I will not use Ant in my next project. Learning to use Ant after make and cook has been like learning C after being used to a functional language. ---- I've recently worked on a rather large ant KludgeFest (for lack of a better term). Our system consisted of about 300,000 lines of java code (no c or anything mixed in). Our ant build system checked out the base system, as well as various other modules from CVS and built it. We also worked with CruiseControl (I contributed a patch to their cvs task), and JUnit, and did many sundry and generally odd things. Suffice it to say, our ant script was big. It was spread across 4 or 5 files, all included into the main one via the execrable xml import mechanism, it loaded a javascript interpreter to do really way-out crazy, cutting-edge tasks like "loop through our list of subprojects". It wasn't a good experience. Througought the 2 years of its evolution, it broke a lot. When it broke, the xml include mechanism hid the actual location of the problem. The api available via the