Bug 70717

Summary: Batch compiler should report compilation errors to console
Product: [Eclipse Project] JDT Reporter: Gunnar Wagenknecht <gunnar>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to apply on HEAD none

Description Gunnar Wagenknecht CLA 2004-07-23 06:57:57 EDT
The batch compiler used by the JDT Ant compiler adapter has a special option 
to log compile errors to a log file if the "verbose" option is used. The 
current implementation stops logging to the error PrintWriter defined in the 
constructor of the batch compiler 
(org.eclipse.jdt.internal.compiler.batch.Main) as soon as a log file is 
specified (verbose option is used).

The disadvantage is that compile warnings and errors are logged only to the 
file and not to the Ant console. If a logger is attached to the Ant console it 
will never recognize compilation errors.

Example: The CruiseControl build system logs Ant builds to XML files (using 
Ant XML logger). After this the XML file is used to detect failed builds 
(builds containing compile errors) and it is transformed vie XSL into nice 
HTML pages. This doesn't work with the JDT compiler adapter reporting compile 
errors to a log file.

The easiest solution would be to replace the error PrintWriter specified in 
the constructor with a "combined" PrintWriter that writes to the console and 
to the log file.
Comment 1 Philipe Mulet CLA 2004-07-23 09:10:39 EDT
Indeed, this would be a good suggestion.
Comment 2 Olivier Thomann CLA 2004-07-23 11:10:38 EDT
I will change it.
Comment 3 Olivier Thomann CLA 2004-07-23 12:08:59 EDT
Created attachment 13566 [details]
Patch to apply on HEAD

This patch enables the err output in the log and in the console.
Comment 4 Olivier Thomann CLA 2004-07-23 12:17:57 EDT
Fixed and released in HEAD.