source: release-kits/lirk3/ant-scripts/tasks/antelope/docs/manual/bk03ch19.html@ 14982

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

initial import of LiRK3

File size: 4.8 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 19. AntFetch</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="bk03ch18.html" title="Chapter 18. SSH and SCP"><link rel="next" href="bk03ch20.html" title="Chapter 20. AntCallBack"></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 19. AntFetch</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03ch18.html">Prev</a> </td><th width="60%" align="center">Additional Ant Tasks</th><td width="20%" align="right"> <a accesskey="n" href="bk03ch20.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="antfetch"></a>Chapter 19. AntFetch</h2></div></div></div>
2<STYLE TYPE="text/css"> <!-- @import url(./style.css); --> </STYLE>
3 <p>
4AntFetch is identical to the standard 'Ant' task, except that it allows properties from the new project to be set in the original project.
5</p><p>
6To use this task in your build files, include a task definition like this:
7</p><pre class="programlisting">
8
9 &lt;taskdef name="antfetch" classname="ise.antelope.tasks.AntFetch"/&gt;
10
11</pre><p>
12</p><p>
13Some background may be in order: When the &lt;ant&gt; task is used, in actuality, a new Ant project is created, and depending on the inheritAll property, it is populated with properties from the original project. Then the target in this new project is executed. Any properties set in the new project remain with that project, they do not get "passed back" to the original project. So, for example, if the target in the new project sets a property named "image.directory", there is no reference to that property in the original. Here's an example of what I mean:
14</p><p>
15Suppose that the "fillImageDirectory" target sets a property named "image.directory" and I call the following:
16</p><pre class="programlisting">
17
18 &lt;ant dir="${image.project} target="fillImageDirectory"/&gt;
19 &lt;echo&gt;${image.directory}&lt;/echo&gt;
20
21</pre><p>
22The output of the echo task will be ${image.directory}, not whatever was set in the "fillImageDirectory" target.
23</p><p>
24The AntFetch task allows that image.directory property to be set in the original project. The attributes for AntFetch are identical to the 'Ant' task, with one additional, optional attibute. This attribute is named "return" and can be either a single property name or a comma separated list of property names.
25</p><p>
26Assuming that "fillImageDirectory" actually sets a property named "image.directory", the following example will print out the directory name:
27</p><pre class="programlisting">
28
29 &lt;antfetch dir="${image.project} target="fillImageDirectory" return="image.directory"/&gt;
30 &lt;echo&gt;${image.directory}&lt;/echo&gt;
31
32</pre><p>
33</p><p>
34And this one will also print out the thumbnail directory:
35</p><pre class="programlisting">
36
37 &lt;antfetch dir="${image.project} target="fillImageDirectory" return="image.directory, thumbnail.directory"/&gt;
38 &lt;echo&gt;${image.directory}&lt;/echo&gt;
39 &lt;echo&gt;${thumbnail.directory}&lt;/echo&gt;
40
41</pre><p>
42</p><p>
43The attributes for AntFetch are identical to the 'ant' task, with one additional, optional attibute. This attribute is named "return" and can be either a single property name or a comma separated list of property names.
44</p><div class="table"><a name="id2524525"></a><p class="title"><b>Table 19.1. AntFetch Attributes</b></p><table summary="AntFetch Attributes" border="1"><colgroup><col><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td>return</td><td>A comma separated list of property names. Whitespace is allowed, so either "a,b" or "a, b" are acceptable.</td><td>None</td><td>No</td></tr></tbody></table></div><p>
45</p><p>
46For other attribute and nested element information and more examples, see the documentation for the "ant" task in the Ant documentation.
47</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk03ch18.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="bk03ch20.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 18. SSH and SCP </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 20. AntCallBack</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.