You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2003/05/16 11:22:30 UTC
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Input.java
bodewig 2003/05/16 02:22:29
Modified: . WHATSNEW
docs/manual/CoreTasks input.html
src/main/org/apache/tools/ant/taskdefs Input.java
Log:
Skip <input> if it is asked to set a property that has already been set.
PR: 19967
Revision Changes Path
1.420 +5 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.419
retrieving revision 1.420
diff -u -r1.419 -r1.420
--- WHATSNEW 15 May 2003 12:44:00 -0000 1.419
+++ WHATSNEW 16 May 2003 09:22:28 -0000 1.420
@@ -34,6 +34,11 @@
now - and we'd like to know about it. The current set of tasks is
supposed to work with any version of VAJ starting with 3.0.
+* <input> will no longer prompt the user and wait for input if the
+ addproperty attribute is set to a property that has already been
+ defined in the project. If you rely on the task waiting for input,
+ don't use the addproperty attribute.
+
Fixed bugs:
-----------
* Filter readers were not handling line endings properly. Bugzilla
1.9 +4 -1 ant/docs/manual/CoreTasks/input.html
Index: input.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTasks/input.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- input.html 7 Apr 2003 16:05:57 -0000 1.8
+++ input.html 16 May 2003 09:22:29 -0000 1.9
@@ -24,7 +24,10 @@
<p>Optionally a property can be created from the value entered by the
user. This property can then be used during the following build
run. Input behaves according to <a href="property.html">property
-task</a> which means that existing properties cannot be overriden.</p>
+task</a> which means that existing properties cannot be overriden.
+Since Ant 1.6, <code><input></code> will not prompt for input if
+a property should be set by the task that has already been set in the
+project (and the task wouldn't have any effect).</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
1.20 +6 -0 ant/src/main/org/apache/tools/ant/taskdefs/Input.java
Index: Input.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Input.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Input.java 7 Mar 2003 11:23:01 -0000 1.19
+++ Input.java 16 May 2003 09:22:29 -0000 1.20
@@ -137,6 +137,12 @@
* @exception BuildException
*/
public void execute () throws BuildException {
+ if (addproperty != null
+ && getProject().getProperty(addproperty) != null) {
+ log("skipping " + getTaskName() + " as property " + addproperty
+ + " has already been set.");
+ }
+
InputRequest request = null;
if (validargs != null) {
Vector accept = StringUtils.split(validargs, ',');