ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Doyle <peter.do...@datalex.ie>
Subject compile error output
Date Wed, 11 Jun 2003 08:22:03 GMT
Hi,

I am trying to capture a compile error (forced for the sake of testing)
which occurs when running ant.
I am invoking ant using a javabean (running on tomcat) which creates an
instance of org.apache.tools.ant.Project as below


//-----
File buildFile = new File("build.xml");
ProjectHelper.configureProject(project, buildFile);
DefaultLogger logger = new DefaultLogger();

FileOutputStream fo = new FileOutputStream(new File("build.log"));
logger.setOutputPrintStream(new PrintStream(fo));
logger.setErrorPrintStream(new PrintStream(fo));
logger.setMessageOutputLevel(debug);
project.addBuildListener(logger);
project.executeTarget(buildTargetStr);
//-----

When this build completes successfully, everything is logged ok to build.log
(i.e. it tells me about all the tasks and what they did).
However, if there is a compile error, then I don't get the actual compile
error added to the log.
The log simply says this...


compileMyStuff:
    [javac] Compiling 1 source file to C:\Source\java\com\myStuff
    
but tomcat prints out...

C:\Source\java\com\myProg.java:3: invalid method declaration; return type
required
    myProg()
    ^
1 error

Does anyone know why I am not getting the compile error returned in the log
and how I might achieve this?
I have tried different levels of debug for the Build Listener

thanks

Peter

*********************************************************************
This electronic transmission is strictly confidential and intended solely
for the addressee. It may contain information which is covered by legal,
professional or other privilege. If you are not the intended addressee,
you must not disclose, copy or take any action in reliance of this
transmission. If you have received this transmission in error, 
please notify the sender as soon as possible.

This footnote also confirms that this message has been swept
for computer viruses.
**********************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message