source: release-kits/wirk3/ant-scripts/tasks/antelope/docs/manual/bk03ch08.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: 3.5 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 8. Unset Task</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="bk03ch07.html" title="Chapter 7. Try Task"><link rel="next" href="bk03ch09.html" title="Chapter 9. Variable 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 8. Unset Task</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03ch07.html">Prev</a> </td><th width="60%" align="center">Additional Ant Tasks</th><td width="20%" align="right"> <a accesskey="n" href="bk03ch09.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Unset"></a>Chapter 8. Unset Task</h2></div></div></div>
2<STYLE TYPE="text/css"> <!-- @import url(./style.css); --> </STYLE>
3 <p>
4The Unset task provides easier access to one of the most used use cases of <a href="bk03ch09.html" title="Chapter 9. Variable Task">Variable</a>, the ability to unset a property. By design, Ant properties are immutable, but sometimes it is handy to set a property to a new value.
5</p><p>
6To use this task in your build files, include a task definition like this:
7</p><p>
8</p><pre class="programlisting">
9
10 &lt;taskdef name="unset" classname="ise.antelope.tasks.Unset"/&gt;
11
12</pre><p>
13</p><p>
14</p><div class="table"><a name="id2521084"></a><p class="title"><b>Table 8.1. Unset Task Attributes</b></p><table summary="Unset Task 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>name</td><td>The name of the property to unset.</td><td>None</td><td>Yes, unless 'file' is used.</td></tr><tr><td>file</td><td>The name of a property file. All properties references in the file will be unset. This means you can load a bunch of properties from a file, then unset them all with a single line.</td><td>None</td><td>Yes, unless 'name' is used.</td></tr></tbody></table></div><p>
15</p><p>
16Example:
17</p><pre class="programlisting">
18
19&lt;project name="unset_example" basedir="."&gt;
20 &lt;taskdef resource="ise/antelope/tasks/antlib.xml"/&gt;
21 &lt;property name="x" value="6"/&gt;
22 &lt;echo&gt;original value = ${x}&lt;/echo&gt;
23 &lt;unset name="x"/&gt;
24 &lt;echo&gt;unset: ${x}&lt;/echo&gt;
25 &lt;property name="x" value="hello"/&gt;
26 &lt;echo&gt;new value = ${x}&lt;/echo&gt;
27&lt;/project&gt;
28
29$ ant -f unset_example.xml
30Buildfile: unset_example.xml
31 [echo] original value = 6
32 [echo] unset: ${x}
33 [echo] new value = hello
34
35BUILD SUCCESSFUL
36Total time: 0 seconds
37
38</pre><p>
39</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk03ch07.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="bk03ch09.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. Try Task </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 9. Variable Task</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.