ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 46203] New: <input> task can lose data
Date Thu, 13 Nov 2008 18:48:35 GMT

           Summary: <input> task can lose data
           Product: Ant
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks


I have an ant file with three input tasks.  When run interactively, they prompt
me, I input whatever values, and all is well.

But now I want to automate running this ant file, so I generate a response file
and feed it into ant as stdin:

ant ... < response.txt

The first input task sucks in the whole response file and the other input tasks
get nothing.  The reason is that DefaultInputHandler.handleInput uses a
BufferedReader on the stdin stream, reads one line (which effectively causes
the buffered reader to read everything it sees), and then the buffered reader
goes out of scope.

Possible solutions:
1. Somehow push back the extra bytes that were read so that the next input task
can read the next line, or
2. Store that BufferedReader somewhere and have the next input task use it
instead of creating a new one, or
3. Don't use a BufferedReader at all; but then you'd lose the ability to do a

Pleas for forgiveness:
* This is a problem that one of my customers has, not me, so I don't have the
full context in which they're doing this.  Essentially, they're using my
company's product to automate something that they normally do by hand /
interactively.  That's all I know.
* I'm not an ANT expert or even novice by any stretch of the imagination, so
forgive me if I'm not using the right terminology in this bug report.
* Even if there's a better way to set up an ANT file to handle interactive and
non-interactive use, I don't know if the customer is willing to make dramatic
changes.  This is a bug.
* The current work-around I've given them is to have a Perl script that prints
a line, sleeps, prints the next line, sleeps, etc.  Not the best solution in
the world, but effective for the time being.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message