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
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
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
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--
March 02, 2005 7:50 AM
> To: user
> Subject: Capture Javac output
>
>
> Hi,
>
> I'm compiling some java files using an Ant project:
>
> Project project = createProject();
> Javac javac = (Javac) project.createTask("javac");
> javac.init();
&g
Hi,
I'm compiling some java files using an Ant project:
Project project = createProject();
Javac javac = (Javac) project.createTask("javac");
javac.init();
...
javac.perform();
And would like to capture the output messages in a log file.
How can I do that?
Thanks,
André
___