ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikas Phonsa <VPho...@suz.com>
Subject RE: How to use the Ant task <input> within WSAD 5?
Date Wed, 06 Aug 2003 15:53:52 GMT
Well Philippe,
Input task will probably just not work in WSAD using only the Ant supplied
by apache. I was trying to use input in WSAD too but despite all the
discussion with people it doesn't work. But people suggested that we use
antelope that has gui mechanism for taking user input.

I didn't want to use antelope so I made up a small java gui program of my
own to take user input.

And just to mention I have also communicated with people at IBM who have
written articles about using Ant in WSAD and they don't have a clue also.

And my IDE WDSC 5 ( upgrade or WSAD ) doesn't come with the latest version
of eclipse and after a lot of search I found that people at eclipse have
fixed this problem in the latest eclipse.I found their bug reports and
stuff.

But for me upgrading eclipse wasn't an option.

So I guess you would either have to use Antelope or make another program to
take input.

Vikas 

-----Original Message-----
From: Philippe Waltregny [mailto:philippe.waltregny@nrb.be] 
Sent: Wednesday, August 06, 2003 4:48 AM
To: user@ant.apache.org
Subject: How to use the Ant task <input> within WSAD 5?

Hello,
 
I would like to execute successfully the following Ant build file both
from WSAD 5 and outside (Command Prompt). I've upgraded the Ant version
from 1.4.1 to 1.5.1 within WSAD to support the Ant task <input>.
 
<?xml version="1.0" encoding="ISO-8859-1"?>
<project
      name="input"
      default="init"
      basedir=".">
 
      <target name="init">
            <!-- Display the Ant version -->
            <echo message="Ant version = ${ant.version}" />
            <!-- Enter something -->
            <input
                  message="Please enter something:"
                  addproperty="user.input" />
            <!-- Display the user's input -->
            <echo message="user.input = ${user.input}" />
      </target>
 
</project>
 
 
So far, I've different results :
 
In WSAD 5
 
                        parsing buildfile
C:\Backup\WSAD5_Workspace1\workspace\AntJ2EE\xml\input.xml with URI =
file:C:/Backup/WSAD5_Workspace1/workspace/AntJ2EE/xml/input.xml
Project base dir set to:
C:\Backup\WSAD5_Workspace1\workspace\AntJ2EE\xml
Arguments: -verbose
Build sequence for target `init' is [init]
Complete build sequence is [init]
Ant version = Ant version 1.5.1 compiled on October 2 2002
Please enter something:
Build exception:
file:C:/Backup/WSAD5_Workspace1/workspace/AntJ2EE/xml/input.xml:13:
Failed to read input from Console.
Build exception:
file:C:/Backup/WSAD5_Workspace1/workspace/AntJ2EE/xml/input.xml:13:
Failed to read input from Console.
file:C:/Backup/WSAD5_Workspace1/workspace/AntJ2EE/xml/input.xml:13:
Failed to read input from Console.
                at
org.apache.tools.ant.input.DefaultInputHandler.handleInput(DefaultInputH
andler.java:94)
                at
org.apache.tools.ant.taskdefs.Input.execute(Input.java:138)
                at org.apache.tools.ant.Task.perform(Task.java:319)
                at org.apache.tools.ant.Target.execute(Target.java:309)
                at
org.apache.tools.ant.Target.performTasks(Target.java:336)
                at
org.apache.tools.ant.Project.executeTarget(Project.java:1306)
                at
org.apache.tools.ant.Project.executeTargets(Project.java:1250)
                at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunne
r.java:262)
                at java.lang.reflect.Method.invoke(Native Method)
                at
org.eclipse.ant.core.AntRunner.run(AntRunner.java:234)
                at
org.eclipse.ui.externaltools.internal.core.AntFileRunner.execute(AntFile
Runner.java:56)
                at
org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.executeR
unner(DefaultRunnerContext.java:428)
                at
org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.run(Defa
ultRunnerContext.java:479)
                at
org.eclipse.ui.externaltools.internal.ui.AntLaunchWizard$1.run(AntLaunch
Wizard.java:117)
                at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalCon
text.java:98)
--- Nested Exception ---
java.io.IOException: The handle is invalid
                at java.io.FileInputStream.readBytes(Native Method)
                at
java.io.FileInputStream.read(FileInputStream.java(Compiled Code))
                at
java.io.BufferedInputStream.read1(BufferedInputStream.java(Compiled
Code))
                at
java.io.BufferedInputStream.read(BufferedInputStream.java(Compiled
Code))
                at
java.io.FilterInputStream.read(FilterInputStream.java(Compiled Code))
                at
java.io.InputStreamReader.fill(InputStreamReader.java(Compiled Code))
                at
java.io.InputStreamReader.read(InputStreamReader.java(Compiled Code))
                at
java.io.BufferedReader.fill(BufferedReader.java(Compiled Code))
                at
java.io.BufferedReader.readLine(BufferedReader.java(Compiled Code))
                at
java.io.BufferedReader.readLine(BufferedReader.java:378)
                at
org.apache.tools.ant.input.DefaultInputHandler.handleInput(DefaultInputH
andler.java:91)
                at
org.apache.tools.ant.taskdefs.Input.execute(Input.java:138)
                at org.apache.tools.ant.Task.perform(Task.java:319)
                at org.apache.tools.ant.Target.execute(Target.java:309)
                at
org.apache.tools.ant.Target.performTasks(Target.java:336)
                at
org.apache.tools.ant.Project.executeTarget(Project.java:1306)
                at
org.apache.tools.ant.Project.executeTargets(Project.java:1250)
                at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunne
r.java:262)
                at java.lang.reflect.Method.invoke(Native Method)
                at
org.eclipse.ant.core.AntRunner.run(AntRunner.java:234)
                at
org.eclipse.ui.externaltools.internal.core.AntFileRunner.execute(AntFile
Runner.java:56)
                at
org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.executeR
unner(DefaultRunnerContext.java:428)
                at
org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.run(Defa
ultRunnerContext.java:479)
                at
org.eclipse.ui.externaltools.internal.ui.AntLaunchWizard$1.run(AntLaunch
Wizard.java:117)
                at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalCon
text.java:98)
Build exception:
file:C:/Backup/WSAD5_Workspace1/workspace/AntJ2EE/xml/input.xml:13:
Failed to read input from Console.
 
            In a Command Prompt
 
            C:\Backup\WSAD5_Workspace1\workspace\AntJ2EE\xml>ant -f
input.xml
Buildfile: input.xml
 
init:
     [echo] Ant version = Apache Ant version 1.5.1 compiled on October 2
2002
    [input] Please enter something:
aaaa
     [echo] user.input = aaaa
 
BUILD SUCCESSFUL
Total time: 2 seconds
C:\Backup\WSAD5_Workspace1\workspace\AntJ2EE\xml>
 
How to allow the <input> usage with WSAD 5 ?
 
Greetings.
 
 
Philippe Waltregny
 mailto:philippe.waltregny@nrb.be
 

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


Mime
View raw message