Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2362

Can't have two inputs after each other

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.1-rc-3
    • Fix Version/s: 1.5
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      The following Gant script fails with the message:

      Enter HTTP proxy host [localhost]: [localhost]

      Enter HTTP proxy port [80]: [80]
      Failed to read input from Console.

      import org.codehaus.groovy.grails.commons.GrailsClassUtils as GCU
      
      grailsHome = Ant.project.properties."environment.GRAILS_HOME"
      
      includeTargets << new File ( "${grailsHome}/scripts/Init.groovy" )  
      
      target('default': "The description of the script goes here!") {
          doStuff()
      }
      
      target(doStuff: "The implementation task") {
      	    def proxyHost = System.getProperty("http.proxyHost") ? System.getProperty("http.proxyHost") : 'localhost'
      	        def proxyPort = System.getProperty("http.proxyPort") ? System.getProperty("http.proxyPort") : '80'
      	        def proxyUser = System.getProperty("http.proxyUserName") ? System.getProperty("http.proxyUserName") : ''
      	        def proxyPassword = System.getProperty("http.proxyPassword") ? System.getProperty("http.proxyPassword") : ''
      
      
      	        Ant.input(addProperty:"proxy.host", message:"Enter HTTP proxy host [${proxyHost}]: ",defaultvalue:proxyHost)
      	       Ant.input(addProperty:"proxy.port", message:"Enter HTTP proxy port [${proxyPort}]: ",defaultvalue:proxyPort)
      	     Ant.input(addProperty:"proxy.user", message:"Enter HTTP proxy username [${proxyUser}]: ",defaultvalue:proxyUser)
      	       Ant.input(addProperty:"proxy.password", message:"Enter HTTP proxy password [${proxyPassword}]: ",defaultvalue:proxyPassword)
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Guillaume Guillaume Delcroix
              Reporter:
              graemerocher Graeme Rocher
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: