ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Dantas Rocha" <ad-ro...@uol.com.br>
Subject Re: Capture Javac output
Date Wed, 02 Mar 2005 20:10:33 GMT
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 FileOutputStream(new File("build.log"));
      logger.setOutputPrintStream(new PrintStream(fo));
      logger.setErrorPrintStream(new PrintStream(fo));
      project.addBuildListener(logger);
    } 
    catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    
    project.addBuildListener(logger); 
    
    project.init();




> 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"); 
> > javac.init(); 
> > ... 
> > javac.perform(); 
> > 
> > And would like to capture the output messages in a log file. 
> > 
> > How can I do that? 
> > 
> > Thanks, 
> > 
> > André 
> > 
> > __________________________________________________________________________ 
> > Acabe com aquelas janelinhas que pulam na sua tela. 
> > AntiPop-up UOL - É grátis! 
> > http://antipopup.uol.com.br/ 
> > 
> > 
> > 
> 
> -- 
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org 
> For additional commands, e-mail: user-help@ant.apache.org 
> 
> 
 
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message