I use the Ant build tool for several different Java projects. And since I'm always looking for new ways to use my favorite tools, I picked up Ant: The Definitive Guide from O’Reilly. With only 288 pages, it covers most topics well enough, but it seems to be lacking in some areas, such as usages for common tasks and reasons for using extension mechanisms.
What does it cover?
The book starts off with a forward by James Duncan Davidson that gives some excellent insight into how the Ant tool was conceived and developed. Normally, I don’t think much about the forward of a book, but in this case, it is an interesting read and worth the few minutes required.
Chapter one introduces Ant in only a few pages. Chapter two covers installation and configuration, providing appropriately short coverage of this simple task. These first two chapters aren't lengthy, but they wouldn't really benefit from being longer because Ant is simple to understand and install. However, I did find that they included a few tips regarding installation and configuration that are useful to even the experienced Ant user.
Chapter three covers the build file and consumes the majority of the book. This chapter goes into some detail regarding the flow and use of build files, and some space is devoted to error handling within the build file. Chapter four covers the data types available within Ant and provides useful information about filesets and patterns.
Chapters five and six cover creating user-defined tasks and listeners, the two different methods by which you can extend the functionality of the Ant build tool. While both of these topics are covered adequately, they seem premature in the book. The degree of information about Ant that is included in the previous chapters could be at best considered a summary or overview.
The coverage for tasks and listeners in these two chapters is probably the best coverage in the book and really points out the details involved in using these mechanisms to extend Ant. Unfortunately, the authors don’t do a good job of explaining some reasons for utilizing these extension mechanisms. I always expect to get some practical advice or examples from the authors. Instead, the tasks and listeners covered in the book are examples of existing functionality.
Looking for more Ant information?
Check out these Builder.com articles to learn more about this build tool:
- "Ant brings pure Java portability, flexibility to key build options"
- "Break free of the built-in tool barrier: Write custom tasks for Ant"
Too short on content
The problem with Ant: The Definitive Guide is simply that it is just too short to make you feel like it's worth the $35 price tag. The majority of the book (starting at page 117 out of 288 pages) is a reference to the Ant core and optional tasks. These are adequately covered in the online documentation, and other than some formatting differences, these points are just duplicated verbatim in the book.
This could have been a better book if the authors had spent more time covering different ways to use the build tool for some more common tasks that occupy so much of the book's volume, such as source code checkout, automation of daily builds, and tips on using the core tasks. If you want to know more about Ant, I suggest reading the online documentation and experimenting with using Ant build files in your own projects. This book just doesn’t deliver the extra information I’ve come to expect from O’Reilly titles, so I wouldn’t recommend adding it to your library.