Chapter 3. Automation

Ant

Now let’s dive into Ant, which stands for Another Neat Tool. Ant was actually created as a build scripting language for Java development, but because it can be easily extended, it can also be used for other languages. Ant can help you automate your daily development tasks, including but not limited to compiling, testing, packaging, deploying, and documenting. Everything you can do with the command line—and more—you can do with Ant! You can also run Ant directly from the command line, but for the exercises in this book we will be running Ant only from within Eclipse.

Ant is a task-oriented build system, which means it allows you to create tasks and run them in a linear way—i.e., one after another. But, of course, tasks—or targets, as Ant calls them—can have dependencies on other tasks.

Before we can start playing around with Ant, we need to make sure we have all the JAR files in place and set up.

Note

JAR files are Java ARchives, a way to distribute source code or libraries. These files hold different files, ranging from source code to images and text files.

I have prepared a zip file with all the JAR files you’ll need for this book. You can find it at http://book.funky-monkey.nl/. Just unpack this zip somewhere on your hard drive where you see fit.

Now open up Eclipse’s preferences and click on the Ant options on the left side. Select the checkbox for “Always run new Ant config...” (Figure 3-1). Checking this option ensures that we don’t ...

Get Automating ActionScript Projects with Eclipse and Ant now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.