Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 18643 invoked from network); 9 May 2003 15:57:24 -0000 Received: from mailhost2.cnf.com (HELO ljcqs053.cnf.com) (63.230.177.24) by daedalus.apache.org with SMTP; 9 May 2003 15:57:24 -0000 Received: from cnfqs057.cnf.prod.cnf.com (localhost [127.0.0.1]) by ljcqs053.cnf.com (Postfix) with ESMTP id 16F905E2; Fri, 9 May 2003 08:57:23 -0700 (PDT) Received: by cnfqs057.cnf.prod.cnf.com with Internet Mail Service (5.5.2653.19) id ; Fri, 9 May 2003 08:57:22 -0700 Message-ID: From: "Anderson, Robert H - MWT" To: 'Ant Users List' , "'ant-user@apache.org'" Cc: "Weir, John" Subject: RE: Getting input in a custom ant task Date: Fri, 9 May 2003 08:57:16 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Perhaps a combination of the , and tasks would suit your needs without having to use a custom task. This is how I would do it... Create a reademe.txt file with a replacement token. During the build promt for input with the input task. Then use the task the enter the intup into the readme.txt file. Then zip it up. I know this does not answer your question but it might help you get the results you want. -Rob A -----Original Message----- From: Baldry, Scot M [mailto:Scot.Baldry@gs.com] Sent: Friday, May 09, 2003 6:13 AM To: 'ant-user@apache.org' Cc: Weir, John Subject: Getting input in a custom ant task Hi, I'm trying to write a custom ant task that will essentially jar up a collection of classes and store an internal readme.txt that contains the developers comments on why the changes have been packaged. To achieve this I have extended the existing 'Zip' task and added my own routines to prompt for comments and compose the readme.txt file. The problem I am having is that the following lines of code cause very strange behaviour when run as part of the task: System.out.print("\nWould you like to continue (Y/N): "); String response = input.readLine(); if (response.equalsIgnoreCase("Y")) return true; else if (response.equalsIgnoreCase("N")) return false; Basically, the build appears to hang but is infact waiting for input. When I enter something and press return the output shows the line "Would you like to continue?" - even though it appears before the input.readLine statement. Since I do this in several places within the task I have made sure that the various BufferedReaders that I use to grab input are being closed in the relevant finally blocks. I'm running Ant 1.5 on JDK 1.4.1 - as far as I can remember similar code ran without problems under Ant 1.3 and Ant 1.4 under JDK 1.3. Anyone able to provide an insight as to what may be happening? Scot