1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>Echo Task</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2><a name="echo">Echo</a></h2>
|
---|
12 | <h3>Description</h3>
|
---|
13 | <p>Echoes a message to the current loggers and listeners which
|
---|
14 | means <tt>System.out</tt> unless overridden. A <tt>level</tt>
|
---|
15 | can be specified, which controls at what logging level the message is
|
---|
16 | filtered at.
|
---|
17 | <p>
|
---|
18 | The task can also echo to a file, in which case the option to append rather
|
---|
19 | than overwrite the file is available, and the <tt>level</tt> option is
|
---|
20 | ignored</p>
|
---|
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">message</td>
|
---|
30 | <td valign="top">the message to echo.</td>
|
---|
31 | <td valign="top" align="center">Yes, unless data is included in a
|
---|
32 | character section within this element.</td>
|
---|
33 | </tr>
|
---|
34 | <tr>
|
---|
35 | <td valign="top">file</td>
|
---|
36 | <td valign="top">the file to write the message to.</td>
|
---|
37 | <td valign="top" align="center">No</td>
|
---|
38 | </tr>
|
---|
39 | <tr>
|
---|
40 | <td valign="top">append</td>
|
---|
41 | <td valign="top">Append to an existing file?</td>
|
---|
42 | <td valign="top" align="center">No - default is false.</td>
|
---|
43 | </tr>
|
---|
44 | <tr>
|
---|
45 | <td valign="top">level</td>
|
---|
46 | <td valign="top">Control the level at which this message is reported.
|
---|
47 | One of "error", "warning", "info", "verbose", "debug"</td>
|
---|
48 | <td valign="top" align="center">No - default is "warning".</td>
|
---|
49 | </tr>
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 | </table>
|
---|
54 | <h3>Examples</h3>
|
---|
55 | <pre>
|
---|
56 | <echo message="Hello, world"/>
|
---|
57 | </pre>
|
---|
58 | <pre>
|
---|
59 | <echo message="Embed a line break:${line.separator}"/>
|
---|
60 | </pre>
|
---|
61 | <pre>
|
---|
62 | <echo>Embed another:${line.separator}</echo>
|
---|
63 | </pre>
|
---|
64 | <pre>
|
---|
65 | <echo>This is a longer message stretching over
|
---|
66 | two lines.
|
---|
67 | </echo>
|
---|
68 | </pre>
|
---|
69 | <pre>
|
---|
70 | <echo>
|
---|
71 | This is a longer message stretching over
|
---|
72 | three lines; the first line is a blank
|
---|
73 | </echo>
|
---|
74 | </pre>
|
---|
75 | As XML parsers are wont to do, the first newline in the text element
|
---|
76 | has been included in the text.
|
---|
77 |
|
---|
78 | <pre><echo message="Deleting drive C:" level="debug"/></pre>
|
---|
79 | A message which only appears in <tt>-debug</tt> mode.
|
---|
80 | <pre><echo level="error">
|
---|
81 | Imminent failure in the antimatter containment facility.
|
---|
82 | Please withdraw to safe location at least 50km away.
|
---|
83 | </echo>
|
---|
84 | </pre>
|
---|
85 | A message which appears even in <tt>-quiet</tt> mode.
|
---|
86 |
|
---|
87 | <pre><echo file="runner.csh" append="false">#\!/bin/tcsh
|
---|
88 | java-1.3.1 -mx1024m ${project.entrypoint} $$*
|
---|
89 | </echo></pre>
|
---|
90 | Generate a shell script by echoing to a file.
|
---|
91 | Note the use of a double $ symbol to stop Ant
|
---|
92 | filtering out the single $ during variable expansion
|
---|
93 | <hr>
|
---|
94 |
|
---|
95 | <p align="center">Copyright © 2000-2002,2004 The Apache Software Foundation. All rights
|
---|
96 | Reserved.</p>
|
---|
97 |
|
---|
98 | </body>
|
---|
99 | </html>
|
---|
100 |
|
---|