This file is indexed.

/usr/share/doc/libantelope-java/manual/bk03ch09.html is in libantelope-java-doc 3.5.1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 9. Variable Task</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Antelope Users Guide"><link rel="up" href="bk03.html" title="Additional Ant Tasks"><link rel="prev" href="bk03ch08.html" title="Chapter 8. Unset Task"><link rel="next" href="bk03ch10.html" title="Chapter 10. Stopwatch"></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 9. Variable Task</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03ch08.html">Prev</a> </td><th width="60%" align="center">Additional Ant Tasks</th><td width="20%" align="right"> <a accesskey="n" href="bk03ch10.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 9. Variable Task"><div class="titlepage"><div><div><h2 class="title"><a name="Variable"></a>Chapter 9. Variable Task</h2></div></div></div>
@style@
    <p>
The Variable task provides a mutable property to Ant and works much like variable assignment in Java. This task is similar to the standard Ant Property task, except that THESE PROPERTIES ARE MUTABLE. While this goes against the standard Ant use of properties, occasionally it is useful to be able to change a property value within the build. <span class="bold"><strong>In general, use of this task is DISCOURAGED, and the standard Ant Property should be used if possible.</strong></span> Having said that, in real life I use this a lot.
</p><p>
To use this task in your build files, include a task definition like this:
</p><p>
</p><pre class="programlisting">

    &lt;taskdef name="var" classname="ise.antelope.tasks.Variable"/&gt;
   
</pre><p>
</p><p>
Variables can be set individually or loaded from a standard properties file. A 'feature' of variables is that they can override properties, but properties cannot override variables. So if an already established property exists, its value can be reassigned by use of this task.
</p><p>
</p><div class="table"><a name="id2517029"></a><p class="title"><b>Table 9.1. Variable Task Attributes</b></p><div class="table-contents"><table summary="Variable 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 set.</td><td>None</td><td>Yes, unless 'file' is used.</td></tr><tr><td>value</td><td>The value of the property.</td><td>""</td><td>No</td></tr><tr><td>file</td><td>The name of a standard properties file to load variables from.</td><td>None</td><td>No</td></tr></tbody></table></div></div><p><br class="table-break">
</p><p>
In the following example, the property <code class="computeroutput">x</code> is first set to "6", then evaluated by the <code class="computeroutput">if</code>, and reassigned the value "12". The <code class="computeroutput">echo</code> task will print out 12.
</p><p>
</p><pre class="programlisting">

    &lt;var name="x" value="6"/&gt;
    &lt;if name="x" value="6"&gt;
        &lt;var name="x" value="12"/&gt;
    &lt;/if&gt;
    &lt;echo&gt;${x}&lt;/echo&gt;   &lt;!-- will print 12 --&gt;

</pre><p>
</p><p>
The following shows some more uses of the Variable task. It is especially handy for property appending. Notice a couple of things: the property task can't override a var value, however, if the var value is set to "", then it can as in the case of the format example.
</p><p>
</p><pre class="programlisting">

    &lt;var name="x" value="6"/&gt;
    &lt;echo&gt;x = ${x}&lt;/echo&gt;   &lt;!-- print: 6 --&gt;

    &lt;var name="x" value="12"/&gt;
    &lt;echo&gt;x = ${x}&lt;/echo&gt;   &lt;!-- print: 12 --&gt;

    &lt;var name="x" value="6 + ${x}"/&gt;
    &lt;echo&gt;x = ${x}&lt;/echo&gt;   &lt;!-- print: 6 + 12 --&gt;

    &lt;var name="str" value="I "/&gt;
    &lt;var name="str" value="${str} am "/&gt;
    &lt;var name="str" value="${str} a "/&gt;
    &lt;var name="str" value="${str} string."/&gt;
    &lt;echo&gt;${str}&lt;/echo&gt;     &lt;!-- print: I am a string. --&gt;

    &lt;var name="x" value="6"/&gt;
    &lt;echo&gt;x = ${x}&lt;/echo&gt;   &lt;!-- print: 6 --&gt;

    &lt;property name="x" value="12"/&gt;
    &lt;echo&gt;x = ${x}&lt;/echo&gt;   &lt;!-- print: 6 (property can't override) --&gt;

    &lt;var name="x" value="blue"/&gt;
    &lt;tstamp&gt;
        &lt;format property="x" pattern="EEEE"/&gt;
    &lt;/tstamp&gt;
    &lt;echo&gt;Today is ${x}.&lt;/echo&gt; &lt;!-- print: Today is blue. --&gt;

    &lt;var name="x" value=""/&gt;
    &lt;tstamp&gt;
        &lt;format property="x" pattern="EEEE"/&gt;
    &lt;/tstamp&gt;
    &lt;echo&gt;Today is ${x}.&lt;/echo&gt; &lt;!-- print: Today is Friday. --&gt;


</pre><p>
</p><p>
The next example shows Variable, If, Assert, and Try working together to make sure e-mail is sent from the right address and that if the mail fails to be sent for any reason, the build will not fail.
</p><p>
</p><pre class="programlisting">
    
   &lt;var name="valid_email" value="false"/&gt;
   &lt;if name="email_from" value="buildteam@mycompany.com"&gt;
      &lt;var name="valid_email" value="true"/&gt;
   &lt;/if&gt;
   &lt;if name="email_from" value="buildsite@mycompany.com"&gt;
      &lt;var name="valid_email" value="true"/&gt;
   &lt;/if&gt;
   &lt;assert name="valid_email" value="true" failonerror="false"&gt;
      &lt;try&gt;
         &lt;mail from="${email_from}" tolist="${email_to}"
            message="New release available"/&gt;
      &lt;/try&gt;
   &lt;/assert&gt;
   
</pre><p>
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk03ch08.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="bk03ch10.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 8. Unset Task </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 10. Stopwatch</td></tr></table></div></body></html>