1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css"/>
|
---|
6 | <title>Length Task</title>
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2>Length</h2>
|
---|
12 | <h3>Description</h3>
|
---|
13 | <p>Display or set a property containing length information for
|
---|
14 | a string, a file, or one or more nested filesets. Can also
|
---|
15 | be used as a condition. <b>Since Ant 1.6.3</b></p>
|
---|
16 | <h3>Parameters</h3>
|
---|
17 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
18 | <tr>
|
---|
19 | <td valign="top"><b>Attribute</b></td>
|
---|
20 | <td valign="top"><b>Description</b></td>
|
---|
21 | <td align="center" valign="top"><b>Required</b></td>
|
---|
22 | </tr>
|
---|
23 | <tr>
|
---|
24 | <td valign="top">property</td>
|
---|
25 | <td valign="top">The property to set. If omitted
|
---|
26 | the results are written to the log. Ignored when
|
---|
27 | processing as a condition.</td>
|
---|
28 | <td valign="top" align="center">No</td>
|
---|
29 | </tr>
|
---|
30 | <tr>
|
---|
31 | <td valign="top">file</td>
|
---|
32 | <td valign="top">Single file whose length to report.</td>
|
---|
33 | <td valign="top" align="center" rowspan="2">One of these,
|
---|
34 | or one or more nested filesets</td>
|
---|
35 | </tr>
|
---|
36 | <tr>
|
---|
37 | <td valign="top">string</td>
|
---|
38 | <td valign="top">The string whose length to report.</td>
|
---|
39 | </tr>
|
---|
40 | <tr>
|
---|
41 | <td valign="top">mode</td>
|
---|
42 | <td valign="top">File length mode; when "all" the resulting
|
---|
43 | value is the sum of all included files' lengths; when "each"
|
---|
44 | the task outputs the absolute path and length of each included file,
|
---|
45 | one per line. Ignored when processing as a condition.</td>
|
---|
46 | <td valign="top" align="center">No; default is "all"</td>
|
---|
47 | </tr>
|
---|
48 | <tr>
|
---|
49 | <td valign="top">trim</td>
|
---|
50 | <td valign="top">Whether to trim when operating on a string.</td>
|
---|
51 | <td valign="top" align="center">No; only valid when string is set</td>
|
---|
52 | </tr>
|
---|
53 | <tr>
|
---|
54 | <td valign="top">length</td>
|
---|
55 | <td valign="top">Comparison length for processing as a condition.</td>
|
---|
56 | <td valign="top" align="center">Yes, in condition mode</td>
|
---|
57 | </tr>
|
---|
58 | <tr>
|
---|
59 | <td valign="top">when</td>
|
---|
60 | <td valign="top">Comparison type: "equal", "greater", "less"
|
---|
61 | for use when operating as a condition.</td>
|
---|
62 | <td valign="top" align="center">No; default is "equal"</td>
|
---|
63 | </tr>
|
---|
64 | </table>
|
---|
65 | <h3>Parameters specified as nested elements</h3>
|
---|
66 | <h4>fileset</h4><p>You can include files via nested
|
---|
67 | <a href="../CoreTypes/fileset.html">fileset</a>s.</p>
|
---|
68 | <h3>Examples</h3>
|
---|
69 | <pre><length string="foo" property="length.foo" />
|
---|
70 | </pre>
|
---|
71 | <p>Stores the length of the string "foo" in the property named
|
---|
72 | <i>length.foo</i>.</p>
|
---|
73 | <pre><length file="bar" property="length.bar" />
|
---|
74 | </pre>
|
---|
75 | <p>Stores the length of file "bar" in the property named
|
---|
76 | <i>length.bar</i>.</p>
|
---|
77 | <hr />
|
---|
78 | <p align="center">Copyright © 2005 The Apache Software Foundation.
|
---|
79 | All rights Reserved.</p>
|
---|
80 | </body>
|
---|
81 | </html>
|
---|
82 |
|
---|