O'Reilly logo

Ant: The Definitive Guide by Jesse Tilly, Eric M. Burke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

An Example Project and Buildfile

To provide an example buildfile for this book, we need an example project. We use a project that already exists as a GNU Make-based project called irssibot, an IRC bot[16] written by Matti Dahlbom (the original can be found at http://dreamland.tky.hut.fi/IrssiBot). This project requires all the features of a typical build: compiling source code, packaging classes, cleaning directories, and deploying the application. As an exercise, we took this project and converted it to use Ant.

Understanding the Project Structure

Let’s begin by looking at how we configure the directories for the irssibot project. Java project organization methods vary — sometimes considerably so — depending on the project (e.g., web applications have very different project structures from GUI tools). Many times, the tools dictate a project’s structure. Some IDE’s, for example VisualAge versions prior to 3.5, require that all source code is in one file. EJB and CORBA compilers require naming conventions for source files and directories. For all cases, the project model should fit the requirements of your revision control system (you use a revision control system, right?). Because of such varied requirements and dependencies, a perfect project organizational pattern does not exist and we do not propose to suggest one here. The layout and organization we describe, however, is simple enough to work with many projects, and it works especially well with Ant.

Designing and implementing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required