I read through all the responses to your question. I saw nothing that addressed this.
Your question addresses an issue with is the same problem as running a KSH interactive script from the ant exec command. Specifically, ant does not block for user input when a script executes a read command ,at least, using the following configuration:
ant build.xml snippet:
<target name="promote" depends=""
description="Usage: ant promote">
<echo message="running: build-promote.sh"/>
<exec
dir="${clearance.dir}"
spawn="false"
executable="/bin/ksh">
<arg line='-c "build-promote.sh < $STDIN"'/>
</exec>
</target>
ksh: build-promote.sh snippet:
echo
echo "Select kit number: "
typeset -i akit
read aKit
echo "Is this kit number ok? $aKit" Upon execution of the read command, ant must stop and allow the user to enter a response. Instead what is happening is execution continues with the next line in the shell pgm. I can't enter a response to any of the reads in the pgm.
Seems this is just operator error on our part. But, I've messed around with this too long and tried several different approaches.
Were you able to get this working?
thx in advance. kev.
gboysko wrote:
I am using Ant to automate the creation of some Java classes and compile them. I also want to be able to execute one of these generated Java classes (which has a builtin command processor). The commands are entered by the user (interactively) and the output is sent back to the console (via System.out).
I simply want to use either the JAVA or EXEC task to invoke the class, but I can't get the stdin and stdout to be routed to the class. I can see lots of ways to wire up the input/output to files, but no way to have them wired back to the Ant console. Am I missing something? Without specifying anything, I don't see anything and can't enter anything. Is there a way I can specify the console/terminal in Windows using the input and output attributes?
I am using Ant 1.6.5 on Windows.