1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>Echoproperties Task</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2><a name="echoproperties">echoproperties</a></h2>
|
---|
12 | <h3>Description</h3>
|
---|
13 |
|
---|
14 | <p>Displays all the current properties (or a subset of them specified
|
---|
15 | by a nested <code><propertyset></code>) in the project. The
|
---|
16 | output can be sent to a file if desired. This task can be used as a
|
---|
17 | somewhat contrived means of returning data from an
|
---|
18 | <tt><ant></tt> invocation, but is really for debugging build
|
---|
19 | files.</p>
|
---|
20 |
|
---|
21 | <h3>Parameters</h3>
|
---|
22 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
23 | <tr>
|
---|
24 | <td valign="top"><b>Attribute</b></td>
|
---|
25 | <td valign="top"><b>Description</b></td>
|
---|
26 | <td align="center" valign="top"><b>Required</b></td>
|
---|
27 | </tr>
|
---|
28 | <tr>
|
---|
29 | <td valign="top">destfile</td>
|
---|
30 | <td valign="top">If specified, the value indicates the name of the
|
---|
31 | file to send the output of the statement to. The generated output file
|
---|
32 | is compatible for loading by any Java application as a property file.
|
---|
33 | If not specified, then the output will go to the Ant log.</td>
|
---|
34 | <td valign="top" align="center">No</td>
|
---|
35 | </tr>
|
---|
36 | <tr>
|
---|
37 | <td valign="top">prefix</td>
|
---|
38 | <td valign="top">
|
---|
39 | a prefix which is used to filter the properties
|
---|
40 | only those properties starting with this prefix will be echoed.
|
---|
41 | <P>
|
---|
42 | </td>
|
---|
43 | <td valign="top" align="center">No</td>
|
---|
44 | </tr>
|
---|
45 |
|
---|
46 |
|
---|
47 |
|
---|
48 | <tr>
|
---|
49 | <td valign="top">failonerror</td>
|
---|
50 | <td valign="top">By default, the "failonerror" attribute is enabled.
|
---|
51 | If an error occurs while writing the properties to a file, and this
|
---|
52 | attribute is enabled, then a BuildException will be thrown, causing the
|
---|
53 | build to fail. If disabled, then IO errors will be reported as a log
|
---|
54 | statement, and the build will continue without failure from this task.</td>
|
---|
55 | <td valign="top" align="center">No</td>
|
---|
56 | </tr>
|
---|
57 |
|
---|
58 | <tr>
|
---|
59 | <td valign="top">format</td>
|
---|
60 | <td valign="top">One of <code>text</code> or <code>xml</code>.
|
---|
61 | Determines the output format. Defaults to <code>text</code>.</td>
|
---|
62 | <td valign="top" align="center">No</td>
|
---|
63 | </tr>
|
---|
64 | </table>
|
---|
65 |
|
---|
66 | <h3>Parameters specified as nested elements</h3>
|
---|
67 |
|
---|
68 | <h4>propertyset</h4>
|
---|
69 |
|
---|
70 | <p>You can specify subsets of properties to be echoed with <a
|
---|
71 | href="../CoreTypes/propertyset.html">propertyset</a>s.</p>
|
---|
72 |
|
---|
73 | <p><em>since Ant 1.6</em>.</p>
|
---|
74 |
|
---|
75 | <h3>Examples</h3>
|
---|
76 | <blockquote><pre>
|
---|
77 | <echoproperties/>
|
---|
78 | </pre></blockquote>
|
---|
79 | <p>Report the current properties to the log.</p>
|
---|
80 | <blockquote><pre>
|
---|
81 | <echoproperties destfile="my.properties"/>
|
---|
82 | </pre></blockquote>
|
---|
83 | <p>Report the current properties to the file "my.properties", and will
|
---|
84 | fail the build if the file could not be created or written to.</p>
|
---|
85 | <blockquote><pre>
|
---|
86 | <echoproperties destfile="my.properties" failonerror="false"/>
|
---|
87 | </pre></blockquote>
|
---|
88 | <p>Report the current properties to the file "my.properties", and will
|
---|
89 | log a message if the file could not be created or written to, but will still
|
---|
90 | allow the build to continue.</p>
|
---|
91 | <blockquote><pre>
|
---|
92 | <echoproperties prefix="java."/>
|
---|
93 | </pre></blockquote>
|
---|
94 | <p>List all properties beginning with "java."</p>
|
---|
95 | <blockquote><pre>
|
---|
96 | <echoproperties>
|
---|
97 | <propertyset>
|
---|
98 | <propertyref prefix="java."/>
|
---|
99 | </propertyset>
|
---|
100 | </echoproperties>
|
---|
101 | </pre></blockquote>
|
---|
102 | <p>List all properties beginning with "java."</p>
|
---|
103 |
|
---|
104 | <hr>
|
---|
105 | <p align="center">Copyright © 2002-2004 The Apache Software Foundation. All rights
|
---|
106 | Reserved.</p>
|
---|
107 |
|
---|
108 | </body>
|
---|
109 | </html>
|
---|
110 |
|
---|