Summary: | Problem with Input task | ||
---|---|---|---|
Product: | Ant | Reporter: | Ronan Mulvaney <rmulvaney> |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.7.0 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other |
Description
Ronan Mulvaney
2006-11-23 04:34:03 UTC
What's probably happening is that the input is being routed to the forked java program, which is ignoring it. If you dont want this behaviour, add inputstring="" to the <java> task. Now, the interesting question is why is this happening after the forked java program has terminated. I can confirm that works around the issue. That said, we have a fairly large number of forked <java> tasks in our scripts and others not under our control that we import to make this change in. How likely would it be to see a fix for this issue in the final release? I've encountered similar behaviour in version 1.6.5 and 1.7.0 (1.6.2 is ok). It seems the input has to pass through the hierarchy of forked java calls before the input is accepted. So <target name="test-forked-inputs"> <input>Not called java so assuming 1 return to continue.</input> <echo>Calling java </echo> <java classname="Hello" classpath="." fork="true"/> <echo>Calling java for the second time</echo> <java classname="Hello" classpath="." fork="true"/> <echo>Calling java for the third time</echo> <java classname="Hello" classpath="." fork="true"/> <echo>Calling java for the fourth time</echo> <java classname="Hello" classpath="." fork="true"/> <input>Called java 4 times since last input, so assuming 5 returns to continue (4 for each forked java, plus 1 for the input).</input> </target> requires the return key to be pressed once initially, then 5 times (as the message says, 4 times for the number of forked java instances, plus one for the input task itself). Doing either of a) removing the forked attribute or b) setting inputstring="" in the java call gets around the problem. IMHO the problem is as likely to be in the java task as in the input task. Ant 1.6.3 saw a fix to the java task [Programs run with <java fork="true"> can now accept standard input from the Ant console. (Programs run with <java fork="false"> could already do so.) Bugzilla 24918.] |