Antlion
Welcome
License
 
How-To Guides
Getting Started
Libraries
Artifacts
Subprojects
Repositories
Policy Strategies
Format Strings
Extending Antlion
FAQ
 
Tutorials
First Tutorial: Simple
 
Ant Tasks
<artifact>
<libraryDef>
<library>
<library-policy>
inner processors
inner repositories
<library-type>
<library-repository>
<library-urlrepository>
<library-mavenrepository>
<library-repositoryset>
<create-artifact>
<subprojects>
<run-subproject>
<replace-target>
 
Optional Tasks
About optional tasks
RegexpTokenFormatter
 
TOC   Next  
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.

Our project is arranged in a tree structure like so:

 [root]/
 +- lib/
 +- src/
    +- java/
    +- tests/

Very simple. The lib/ directory stores all the binary external libraries we depend upon (more on that later). The src/ directory contains the sources for the main project (java/) and the unit tests (tests/). Each of these contains Java source code and possible non-Java resources.

Resources and Dependencies

Using Antlion puts some constraints around what we can use to build our project. First off, Antlion requires at least JDK 1.2, and Ant version 1.6 or higher. Since Ant 1.6 has a minimum requirement of JDK 1.2, Antlion doesn't put any additional restraints there.

So, let's say our project uses:

For purposes of testing, we'll also need to have JUnit version 3.8.1.


Setting Up The Resources

Let's say that you installed the Sun JDK on your system, and you set the environment variable JAVA_HOME to point to that JDK's base directory.

Let's also say that you installed Ant on your computer, and you set the environment variable ANT_HOME to point to the base directory of the Ant 1.6.2 install.

Now, we need to make sure that our project can retrieve the explicit version of each dependent library files from our build. Let's go against the Maven grain by setting up our lib/ directory like this:

 [root]/
 +- lib/
    +- antlion/
       +- 0.9.0/
          +- antlion-inline-0.9.0.jar
    +- log4j/
       +- 1.2.8/
          +- log4j-1.2.8.jar
    +- xerces/
       +- 2.6.2/
          +- xmlParserAPIs.jar
          +- xercesImpl.jar
    +- junit/
       +- 3.8.1/
          +- junit.jar

So that in each directory, we can store the binary files along with their license and notice files. If we were so inclined, we could also add the JavaDoc and even Java source here, to that developers could more easily use those libraries. For build purposes, though, all we need to know about are the binary library files.

Since we plan on using the JUnit Ant task, we must make sure that, when we invoke Ant, Ant knows about the JUnit jar file. To do this, we also add the environment variable LOCALCLASSPATH to point to our project's JUnit library file (or, if you want, at some other location).


Where The Build Puts Its Generated Files

We also need to define where the build can put the files it creates. Let's say that all the files that get created, but aren't deployed, get put into the work/ directory, while the files that do get deployed get put into the dist/ directory:

 [root]/
 +- work/
 +- dist/


TOC   Next  
Document version $Revision: 1.4 $ $Date: 2005/10/28 22:18:55 $

SourceForge Logo
Copyright © 2004-2006, The Antlion Project