Re: Capture Javac output

2005-03-02 Thread Andre Dantas Rocha
I'm trying to use DefaultLogger and my implementation is shown below. The log file is created but still empty after javac task run. Any ideas? Thanks Project project = new Project(); DefaultLogger logger; try { logger = new DefaultLogger(); FileOutputStream fo = new Fi

RE: Capture Javac output

2005-03-02 Thread Andre Dantas Rocha
I'm trying to work with DefaultLogger, and created this code: Project project = new Project(); DefaultLogger logger; try { logger = new DefaultLogger(); FileOutputStream fo = new FileOutputStream(new File("build.log")); logger.setOutputPrintStream(new PrintStream(fo

Re: Capture Javac output

2005-03-02 Thread OpenLDAP User
You may want to look at the Record task as well. You could probably start one of those off programmatically. This will log to a file. > > Hi, > > I'm compiling some java files using an Ant project: > > Project project = createProject(); > Javac javac = (Javac) project.createTask("javac"); > ja

RE: Capture Javac output

2005-03-02 Thread Dominique Devienne
Right, I agree. However, in case you persist in the programmatic way, have a look at BuildLogger and BuildListener, and how they are hooked up to the Project. You could use DefaultLogger, setting the output and error PrintStream to your file, achieving what you want. --DD > -Original Message--

RE: Capture Javac output

2005-03-02 Thread Anderson, Rob (Global Trade)
I would suggest writting a build.xml and running Ant, rather than programming a class to do your compile. Then it becomes as easy as running a command and capturing the output. -Rob A > -Original Message- > From: Andre Dantas Rocha [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 02,