ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: Getting input
Date Tue, 01 Apr 2003 05:03:01 GMT
On Tue, 1 Apr 2003 12:59 pm, Oki DZ wrote:
> Hi,
>
> I have something like the following in my build.xml:
>   <target name="execute" depends="compile" description="execute the
> app">
>     <exec dir="${ojbhome}" executable="${javahome}/bin/java">
>       <arg line="MyClass"/>
>     </exec>
>   </target>
>
> MyClass uses Readline.readline(<prompt>) (from
> java-readline.sourceforge.net). Unfortunately, the input is suppressed
> by Ant (meaning, the prompt is not displayed). How can I get it working?
>
> BTW, if I use BufferedReader and have the InputStream from System.in, it
> would be the same thing.
>
> Thanks in advance,
> Oki

In Ant 1.5, you cannot do this. The input stream of processes such as <java> 
and <exec> is not connected to anything. You can redirect input by using the 
external shell to redirect the input for you. This is pretty messy (i.e. 
platform dependent).

In Ant 1.6, you can use a file or a property as input. If input is not 
provided in this form and a task requests input it will be sent eventually to 
the System.in stream. Currently, however, this is managed independently of 
the output stream, which is buffered, so your prompt may still not appear. 
I'm looking into that ...

-- 
Conor MacNeill
Blog: http://codefeed.com/blog/


Mime
View raw message