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 2.8 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 in the project. The output can be
  10. sent to a file if desired. You can also specify a subset of properties
  11. to save by naming a prefix: only properties starting with this
  12. prefix will be saved. This task can be used as a somewhat contrived
  13. means of returning data from an <tt>&lt;ant&gt;</tt> invocation,
  14. but is really for debugging build 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. </table>
  49. <h3>Examples</h3>
  50. <blockquote><pre>
  51. &lt;echoproperties/&gt;
  52. </pre></blockquote>
  53. <p>Report the current properties to the log.</p>
  54. <blockquote><pre>
  55. &lt;echoproperties destfile="my.properties"/&gt;
  56. </pre></blockquote>
  57. <p>Report the current properties to the file "my.properties", and will
  58. fail the build if the file could not be created or written to.</p>
  59. <blockquote><pre>
  60. &lt;echoproperties destfile="my.properties" failonerror="false" /&gt;
  61. </pre></blockquote>
  62. <p>Report the current properties to the file "my.properties", and will
  63. log a message if the file could not be created or written to, but will still
  64. allow the build to continue.</p>
  65. <blockquote><pre>
  66. &lt;echoproperties prefix="java."/&gt;
  67. </pre></blockquote>
  68. <p>List all properties beginning with "java."</p>
  69. <hr>
  70. <p align="center">Copyright &copy; 2002 Apache Software Foundation. All rights
  71. Reserved.</p>
  72. </body>
  73. </html>