From ant-dev-return-11353-apmail-jakarta-ant-dev-archive=jakarta.apache.org@jakarta.apache.org Mon Mar 12 20:49:03 2001 Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@jakarta.apache.org Received: (qmail 86260 invoked by uid 500); 12 Mar 2001 20:48:49 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: ant-dev@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 86220 invoked from network); 12 Mar 2001 20:48:44 -0000 Message-ID: <20010312204849.20534.qmail@web124.yahoomail.com> Date: Mon, 12 Mar 2001 12:48:49 -0800 (PST) From: =?iso-8859-1?q?Paul=20Hammant?= Subject: Re: [ANN] Collecting requirements for Ant2 To: ant-dev@jakarta.apache.org In-Reply-To: <004d01c0aad2$28e03410$97010c3f@cognetnt> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N > That is an interesting issue and I have given it some thought. It is not as > straight forward as might first appear since Ant can run arbitrary Java > classes using the tag and these classes can access System.out > directly. Ideally you want to capture that output and direct it into Ant's > event messages, ant that implies that Ant will have some sort of System.out > handler. > > You also need to include System.err in that. Yes, I knew that things in tools.jar used System.out etc. Maybe we should have a concerted effort to get Sun to make tools.jar a *real* api, with trappable output. All we have to do is get a BugParade bug listed and encourage Ant-list subscribers to vote for it. Sounds daft? Many of the vote in the top 25 have been moved up by organized voting. Why do I want it? I want to add a command line inside Jesktop. Beanshell has been done already, but it seems to me the defacto standard Java command shell should be Ant, it's already the standard batch file language : http://www.jesktop.org/portedapps.html What I had in mind: JavaInst jinst = new JavaInst(); jinst.setClassPath(fredcp); jinst.setMainable("flinstones.Fred"); jinst.setArgs(new String[] {"Wilma","Barney"}); jinst.setSysInStream(something); //.setSysInLines(..) available too. jinst.run(); //.runBackground() an alternative. OutputLines[] oLines = jinst.getSysOutLines(); // err too as well as OutputLineStream variant. for (int f = 0; f < oLines.length; f++) { System.out.println("Line " + f); System.out.println(" Message: " + oLine[f].getMessage); System.out.println(" Time : " + oLine[f].getTime); } Conor thought of an TreadContext idea, but I'm not sure it will work. I think the best bet is to get Sun to change it, and it's not as stupid as it sounds as Sun and Apache are very friendly. ===== Regards - Paul H ==== CVS -1, Perforce +1 __________________________________________________ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: ant-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: ant-dev-help@jakarta.apache.org