ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19967] - Skip input task if property already set
Date Mon, 13 Oct 2003 20:51:29 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19967>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19967

Skip input task if property already set





------- Additional Comments From andy.wood@ditg.tv  2003-10-13 20:51 -------
Hi Steve

<project name="input" default="test">

	<target name="test">
		<property name="foo" value="bar"/>
		<input message="enter value for foo:" addproperty="foo"/>
		<echo>${foo}</echo>
	</target>
	
</project>

Gives output of:

Buildfile: ../../test.xml

test:
    [input] skipping input as property foo has already been set.
    [input] enter value for foo:
fred
     [echo] bar

BUILD SUCCESSFUL
Total time: 3 seconds

That's running with a vanilla binary download of ant 1.6beta1.

If you look at Input.java's execute method:

    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;
        :
        :
    }

There appears to be no other action than logging being taken.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message