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.

input.html 3.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="input">Input</a></h2>
  8. <h3>Description</h3>
  9. <p>Allows user interaction during the build process by displaying a message and
  10. reading a line of input from the console (System.in). The user will need to press
  11. the Return key.
  12. </p>
  13. <p>The message displayed can be set via the message attribute
  14. or as character data nested into the element.</p>
  15. <p>Optinonally a set of valid imput arguments can be defined via the validargs
  16. attribute. Input task will require the user to reenter values until the entered
  17. value matches one of the predefined.</p>
  18. <p>Optionally a property can be created from the value entered by the user. This
  19. property can then be used during the following build run. Input behaves according
  20. to <a href="property.html">property task</a> which means that existing properties
  21. cannot be overriden.</p>
  22. <h3>Parameters</h3>
  23. <table border="1" cellpadding="2" cellspacing="0">
  24. <tr>
  25. <td valign="top"><b>Attribute</b></td>
  26. <td valign="top"><b>Description</b></td>
  27. <td align="center" valign="top"><b>Required</b></td>
  28. </tr>
  29. <tr>
  30. <td valign="top">message</td>
  31. <td valign="top">the Message which gets displayed to the user during the build run.</td>
  32. <td valign="top" align="center">No</td>
  33. </tr>
  34. <tr>
  35. <td valign="top">validargs</td>
  36. <td valign="top">comma separated String containing valid input arguments. If set,
  37. input task will reject any input not defined here and input task will
  38. require the user to reenter arguments until the entered one matches one of the
  39. predefined. Validargs are compared case sensitive. If you want 'a' and 'A' to
  40. be accepted you will need to define both arguments within validargs.</td>
  41. <td valign="top" align="center">No</td>
  42. </tr>
  43. <tr>
  44. <td valign="top">addproperty</td>
  45. <td valign="top">the name of a property to be created from input. Behaviour is equal
  46. to <a href="property.html">property task</a> which means that existing properties
  47. cannot be overriden.</td>
  48. <td valign="top" align="center">No</td>
  49. </tr>
  50. </table>
  51. <h3>Examples</h3>
  52. <pre> &lt;input/&gt;</pre>
  53. <p>Will pause the build run until return key is pressed.</p>
  54. <pre> &lt;input&gt;Press Return key to continue...&lt;/input&gt;</pre>
  55. <p>Will display the message &quot;Press Return key to continue...&quot; and pause
  56. the build run until return key is pressed.</p>
  57. <pre> &lt;input
  58. message=&quot;Press Return key to continue...&quot;
  59. /&gt;</pre>
  60. <p>Will display the message &quot;Press Return key to continue...&quot; and pause
  61. the build run until return key is pressed.</p>
  62. <pre>
  63. &lt;input
  64. message=&quot;All data is going to be deleted from DB continue (y/n)?&quot;
  65. validargs=&quot;y,n&quot;
  66. addproperty=&quot;do.delete&quot;
  67. /&gt;
  68. &lt;condition propert=&quot;do.abort&quot;&gt;
  69. &lt;equals arg1=&quot;n&quot; arg2=&quot;${do.delete}&quot; /&gt;
  70. &lt;/condition&gt;
  71. &lt;fail if=&quot;do.abort&quot;&gt;Build abborted by user.&lt;/fail&gt;
  72. </pre>
  73. <p>Will display the message &quot;All data is going to be deleted from DB continue
  74. (y/n)?&quot; and require 'y+retrun key' to continue build or 'n+return key'
  75. to exit build with following message &quot;Build abborted by user.&quot;.</p>
  76. <pre> &lt;input
  77. message=&quot;Please enter db-username:&quot;
  78. addproperty=&quot;db.user&quot;
  79. /&gt;</pre>
  80. <p>Will display the message &quot;Please enter db-username:&quot; and set the
  81. property <code>db.user</code> to the value entered by the user.</p>
  82. <hr>
  83. <p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
  84. Reserved.</p>
  85. </body>
  86. </html>