How-To Guides
Getting Started
Policy Strategies
Format Strings
Extending Antlion
First Tutorial: Simple
Ant Tasks
inner processors
inner repositories
Optional Tasks
About optional tasks
Enter the Tutorial  
A Simple Project

The first tutorial will cover how to create a simple Java project that includes compiling some source files, with some library dependencies, and creating an output Jar file.

By introducing a simple first step, we can see how the different parts of Antlion work together to make a more consise Ant build script.

The details of the source don't matter for our tutorial. Let's say that we've developed an application that reads in an XML file, and outputs to STDOUT an ASCII tree of the tag names.

To create the build scripts for our project, we'll follow the following plan of attack:

  1. Layout of the Project Before we begin to create our Ant scripts, we need to know how the source files are arranged on the directory structure, and what kind of project we're building. We'll also discuss where the 3rd party libraries live, and what required resources we need.
  2. Add Antlion to the Build When we create the build.xml file, the first thing we'll add is the loading of the Antlion tasks.
  3. Describe What We're Building Antlion likes to focus on what you're going to build, and we'll put that inside a file called artifacts.xml, so that other projects can easily reference what we've built.
  4. External Dependencies We'll look at what it takes to compile the Java code, in particular how we add libraries.
  5. Building the Code And Jars We'll look at what it takes to compile the Java code based on the artifact definition, and then bundling it up into jar files.
  6. Testing the Code Like all good modern Java projects, we use JUnit to test our code. This section shows how to setup the JUnit task to use the right classpath.
  7. Finishing Touches Put the garnish on the build script so that it's a bit more user friendly. This doesn't involve Antlion at all, but it's necessary for any build script.
  8. Epilogue A summary of what we learned, plus a side-by-side comparison between the Antlion approach and the corresponding standard Ant build file.

Enter the Tutorial  
Document version $Revision: 1.4 $ $Date: 2005/10/31 04:37:57 $

SourceForge Logo
Copyright © 2004-2006, The Antlion Project