You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

echoproperties.html 3.4 KiB

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