Chapter 3. Installation

If you are running your build files from Antelope, these tasks are already installed and nothing more needs to be done. The following discusses installing the tasks by hand for use outside of Antelope.

These Ant tasks are packaged as a part of Antelope, which is an application for running Ant build files. They may also be obtained as a separate package. Depending on the distribution you have on hand, copy either antelope.jar or antelope_tasks.jar into your ${ant.home}/lib directory or add it to your classpath. This is the directory where ant.jar and optional.jar are installed for your Ant distribution.

Once installed, each task that you want to use in a build file must be defined in that build file. Since several of the Antelope tasks are dependent on each other, the preferred way to define them is like this:

       
         <taskdef resource="ise.antelope.tasks.antelope.taskdefs
                  classpath="path/to/AntelopeTasks_3.4.0.jar"/>
       
       

This will load all Antelope tasks without further hassle, and will only load the tasks once. It is not good to load the tasks multiple times, this can cause problems with 'ant' and 'antcall' in particular.

If you don't want to load all of the tasks, the documentation for each task explains in detail what you will need to add to your build file to use the individual task. For example, the Assert tasks says:

        To use this task in your build files, include a task definition like this:
        
        <taskdef name="assert" classname="ise.antelope.tasks.Assert"/>
        <property name="ant.enable.asserts" value="true"/>
        
        

Notice that you may name the tasks whatever you want via 'taskdef'. The names listed in the individual task descriptions are those that are set via the preferred method mentioned above.

As of Antelope version 2.64, the 'AntLib' feature of Ant 1.6 is supported, which provides an alternate way of loading optional tasks. If AntelopeTasks_3.4.0.jar is in the core classpath (in ${ant.home}/lib for example) one can use the namespace short-cut to load them:

        
        <project xmlns:antelope="antlib:ise.antelope.tasks">
          <antelope:try messageproperty="failed">
            <fail>This should fail</fail>
            <echo>This will not be reached</echo>
            <antelope:catch>
              <echo>failed is ${failed}</echo>
            </antelope:catch>
          </antelope:try>
        </project>
        
        

Thanks to Peter Reilly of the Ant development team for this pointer and example.