source: release-kits/lirk3/resources/gs3-release-maker/ant/docs/manual/CoreTasks/input.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 4.5 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Input Task</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="input">Input</a></h2>
12<h3>Description</h3>
13
14<p>Allows user interaction during the build process by prompting for
15input. To do so, it uses the configured
16<a href="../inputhandler.html">InputHandler</a>.</p>
17
18<p>The prompt can be set via the message attribute or as character
19data nested into the element.</p>
20
21<p>Optinonally a set of valid imput arguments can be defined via the
22validargs attribute. Input task will no accept value that don't match
23one of the predefined.</p>
24
25<p>Optionally a property can be created from the value entered by the
26user. This property can then be used during the following build
27run. Input behaves according to <a href="property.html">property
28task</a> which means that existing properties cannot be overriden.
29Since Ant 1.6, <code>&lt;input&gt;</code> will not prompt for input if
30a property should be set by the task that has already been set in the
31project (and the task wouldn't have any effect).</p>
32
33<h3>Parameters</h3>
34<table border="1" cellpadding="2" cellspacing="0">
35 <tr>
36 <td valign="top"><b>Attribute</b></td>
37 <td valign="top"><b>Description</b></td>
38 <td align="center" valign="top"><b>Required</b></td>
39 </tr>
40 <tr>
41 <td valign="top">message</td>
42 <td valign="top">the Message which gets displayed to the user
43 during the build run.</td>
44 <td valign="top" align="center">No</td>
45 </tr>
46 <tr>
47 <td valign="top">validargs</td>
48 <td valign="top">comma separated String containing valid input
49 arguments. If set, input task will reject any input not defined
50 here. Validargs are compared case sensitive. If you want 'a' and
51 'A' to be accepted you will need to define both arguments within
52 validargs.</td>
53 <td valign="top" align="center">No</td>
54 </tr>
55 <tr>
56 <td valign="top">addproperty</td>
57 <td valign="top">the name of a property to be created from
58 input. Behaviour is equal to <a href="property.html">property
59 task</a> which means that existing properties cannot be
60 overriden.</td>
61 <td valign="top" align="center">No</td>
62 </tr>
63 <tr>
64 <td valign="top">defaultvalue</td>
65 <td valign="top">Defines the default value of the property to be
66 created from input. Property value will be set to default if no
67 input is received.</td>
68 <td valign="top" align="center">No</td>
69 </tr>
70</table>
71<h3>Examples</h3>
72<pre> &lt;input/&gt;</pre>
73<p>Will pause the build run until return key is pressed when using the
74<a href="../inputhandler.html#defaulthandler">default
75InputHandler</a>, the concrete behavior is defined by the InputHandler
76implementation you use.</p>
77<pre> &lt;input&gt;Press Return key to continue...&lt;/input&gt;</pre>
78<p>Will display the message &quot;Press Return key to
79continue...&quot; and pause the build run until return key is pressed
80(again, the concrete behavior is implementation dependent).</p>
81<pre> &lt;input
82 message=&quot;Press Return key to continue...&quot;
83 /&gt;</pre>
84<p>Will display the message &quot;Press Return key to
85continue...&quot; and pause the build run until return key is pressed
86(see above).</p>
87<pre>
88 &lt;input
89 message=&quot;All data is going to be deleted from DB continue (y/n)?&quot;
90 validargs=&quot;y,n&quot;
91 addproperty=&quot;do.delete&quot;
92 /&gt;
93 &lt;condition property=&quot;do.abort&quot;&gt;
94 &lt;equals arg1=&quot;n&quot; arg2=&quot;${do.delete}&quot;/&gt;
95 &lt;/condition&gt;
96 &lt;fail if=&quot;do.abort&quot;&gt;Build aborted by user.&lt;/fail&gt;
97</pre>
98<p>Will display the message &quot;All data is going to be deleted from
99DB continue (y/n)?&quot; and require 'y' to continue build or 'n' to
100exit build with following message &quot;Build aborted by
101user.&quot;.</p>
102<pre> &lt;input
103 message=&quot;Please enter db-username:&quot;
104 addproperty=&quot;db.user&quot;
105 /&gt;</pre>
106<p>Will display the message &quot;Please enter db-username:&quot; and set the
107property <code>db.user</code> to the value entered by the user.</p>
108
109<pre> &lt;input
110 message=&quot;Please enter db-username:&quot;
111 addproperty=&quot;db.user&quot;
112 defaultvalue=&quot;Scott-Tiger&quot;
113 /&gt;</pre>
114<p>Same as above, but will set <code>db.user</code> to the value
115<i>Scott- Tiger</i> if the user enters no value (simply types
116&lt;return&gt;).</p>
117
118<hr>
119<p align="center">Copyright &copy; 2001-2004 The Apache Software Foundation. All rights
120Reserved.</p>
121</body>
122</html>
Note: See TracBrowser for help on using the repository browser.