source: release-kits/wirk3/ant-scripts/tasks/antelope/docs/manual/bk03ch03.html@ 15023

Last change on this file since 15023 was 15023, checked in by oranfry, 16 years ago

did the bulk of the work on wirk3

File size: 4.6 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 3. Installation</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="Antelope Users Guide"><link rel="up" href="bk03.html" title="Additional Ant Tasks"><link rel="prev" href="bk03ch02.html" title="Chapter 2. License"><link rel="next" href="bk03ch04.html" title="Chapter 4. Assert Task"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Installation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03ch02.html">Prev</a> </td><th width="60%" align="center">Additional Ant Tasks</th><td width="20%" align="right"> <a accesskey="n" href="bk03ch04.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="installation"></a>Chapter 3. Installation</h2></div></div></div>
2<STYLE TYPE="text/css"> <!-- @import url(./style.css); --> </STYLE>
3 <p>
4 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.
5 </p><p>
6 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.
7 </p><p>
8 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:
9 </p><pre class="programlisting">
10
11 &lt;taskdef resource="ise.antelope.tasks.antelope.taskdefs
12 classpath="path/to/AntelopeTasks_3.4.1.jar"/&gt;
13
14 </pre><p>
15 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.
16 </p><p>
17 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:
18 </p><p>
19 </p><pre class="programlisting">
20 To use this task in your build files, include a task definition like this:
21
22 &lt;taskdef name="assert" classname="ise.antelope.tasks.Assert"/&gt;
23 &lt;property name="ant.enable.asserts" value="true"/&gt;
24
25 </pre><p>
26 </p><p>
27 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.
28 </p><p>
29 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.1.jar is in the core classpath (in ${ant.home}/lib for example) one can use the namespace short-cut to load them:
30 </p><pre class="programlisting">
31
32 &lt;project xmlns:antelope="antlib:ise.antelope.tasks"&gt;
33 &lt;antelope:try messageproperty="failed"&gt;
34 &lt;fail&gt;This should fail&lt;/fail&gt;
35 &lt;echo&gt;This will not be reached&lt;/echo&gt;
36 &lt;antelope:catch&gt;
37 &lt;echo&gt;failed is ${failed}&lt;/echo&gt;
38 &lt;/antelope:catch&gt;
39 &lt;/antelope:try&gt;
40 &lt;/project&gt;
41
42 </pre><p>
43 <span class="italic">Thanks to Peter Reilly of the Ant development team for this pointer and example.</span>
44 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk03ch02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk03ch04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. License </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 4. Assert Task</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.