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 4.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 set of exit arguments can be defined via the exitargs attribute.
  19. Input task will throw a BuildException with a customisable exit message if the
  20. entered value matches one of the predefined.</p>
  21. <p>Optionally a property can be created from the value entered by the user. This
  22. property can then be used during the following build run. Input behaves according
  23. to <a href="property.html">property task</a> which means that existing properties
  24. cannot be overriden.</p>
  25. <h3>Parameters</h3>
  26. <table border="1" cellpadding="2" cellspacing="0">
  27. <tr>
  28. <td valign="top"><b>Attribute</b></td>
  29. <td valign="top"><b>Description</b></td>
  30. <td align="center" valign="top"><b>Required</b></td>
  31. </tr>
  32. <tr>
  33. <td valign="top">message</td>
  34. <td valign="top">the Message which gets displayed to the user during the build run.</td>
  35. <td valign="top" align="center">No</td>
  36. </tr>
  37. <tr>
  38. <td valign="top">exitmessage</td>
  39. <td valign="top">the exit message which gets displayed when exiting the build run.</td>
  40. <td valign="top" align="center">No</td>
  41. </tr>
  42. <tr>
  43. <td valign="top">validargs</td>
  44. <td valign="top">comma separated String containing valid input arguments. If set,
  45. input task will reject any input not defined here and input task will
  46. require the user to reenter arguments until the entered one matches one of the
  47. predefined. Validargs are compared case sensitive. If you want 'a' and 'A' to
  48. be accepted you will need to define both arguments within validargs.</td>
  49. <td valign="top" align="center">No</td>
  50. </tr>
  51. <tr>
  52. <td valign="top">exitargs</td>
  53. <td valign="top">comma separated String containing exit arguments. If set,
  54. input task will throw a BuildException with a customisable exit message if the
  55. entered value matches to one of the predefined. Exitargs are compared case
  56. sensitive. If you want 'x' and 'X' to end the build run you will need to define
  57. both arguments within exitargs.</td>
  58. <td valign="top" align="center">No</td>
  59. </tr>
  60. <tr>
  61. <td valign="top">addproperty</td>
  62. <td valign="top">the name of a property to be created from input. Behaviour is equal
  63. to <a href="property.html">property task</a> which means that existing properties
  64. cannot be overriden.</td>
  65. <td valign="top" align="center">No</td>
  66. </tr>
  67. </table>
  68. <h3>Examples</h3>
  69. <pre> &lt;input/&gt;</pre>
  70. <p>Will pause the build run until return key is pressed.</p>
  71. <pre> &lt;input&gt;Press Return key to continue...&lt;/input&gt;</pre>
  72. <p>Will display the message &quot;Press Return key to continue...&quot; and pause
  73. the build run until return key is pressed.</p>
  74. <pre> &lt;input
  75. message=&quot;Press Return key to continue...&quot;
  76. /&gt;</pre>
  77. <p>Will display the message &quot;Press Return key to continue...&quot; and pause
  78. the build run until return key is pressed.</p>
  79. <pre> &lt;input
  80. message=&quot;All data is going to be deleted from DB continue (y/n)?&quot;
  81. validargs=&quot;y,n&quot;
  82. exitargs=&quot;n&quot;
  83. exitmessage=&quot;Build abborted by user.&quot;
  84. /&gt;</pre>
  85. <p>Will display the message &quot;All data is going to be deleted from DB continue
  86. (y/n)?&quot; and require 'y+retrun key' to continue build or 'n+return key'
  87. to exit build with following message &quot;Build abborted by user.&quot;.</p>
  88. <pre> &lt;input
  89. message=&quot;Please enter db-username:&quot;
  90. addproperty=&quot;db.user&quot;
  91. /&gt;</pre>
  92. <p>Will display the message &quot;Please enter db-username:&quot; and set the
  93. property <code>db.user</code> to the value entered by the user.</p>
  94. <hr>
  95. <p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  96. Reserved.</p>
  97. </body>
  98. </html>