> 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 <java> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to