mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug 531043 - Display number of errors/warning as end of build
Changes to ErrorParserManager & implementation of message for legacy build system. Change-Id: Iffc34eeae87bbd2810684fc52a9d9bcd4bb47950 Signed-off-by: William Riley <william.riley@renesas.com>
This commit is contained in:
parent
6a72f4f07c
commit
9e8c775f15
3 changed files with 33 additions and 5 deletions
|
@ -79,6 +79,9 @@ public class ErrorParserManager extends OutputStream implements IConsoleParser,
|
|||
|
||||
private int nOpens;
|
||||
private int lineCounter=0;
|
||||
|
||||
private int errorCounter=0;
|
||||
private int warningCounter=0;
|
||||
|
||||
private final IProject fProject;
|
||||
private final IMarkerGenerator fMarkerGenerator;
|
||||
|
@ -603,8 +606,12 @@ outer:
|
|||
fErrors.add(problemMarkerInfo);
|
||||
problemMarkerInfo.setDeferDeDuplication(deferDeDuplication);
|
||||
fMarkerGenerator.addMarker(problemMarkerInfo);
|
||||
if (problemMarkerInfo.severity == IMarkerGenerator.SEVERITY_ERROR_RESOURCE) {
|
||||
if (problemMarkerInfo.severity == IMarkerGenerator.SEVERITY_ERROR_RESOURCE
|
||||
|| problemMarkerInfo.severity == IMarkerGenerator.SEVERITY_ERROR_BUILD) {
|
||||
hasErrors = true;
|
||||
errorCounter++;
|
||||
} else if (problemMarkerInfo.severity == IMarkerGenerator.SEVERITY_WARNING){
|
||||
warningCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -900,6 +907,14 @@ outer:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getErrorCount() {
|
||||
return errorCounter;
|
||||
}
|
||||
|
||||
public int getWarningCount() {
|
||||
return warningCounter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag the marker generator to defer the de-duplication of error markers
|
||||
|
|
|
@ -455,10 +455,22 @@ public class BuildRunnerHelper implements Closeable {
|
|||
Assert.isTrue(startTime != 0, "Start time must be set before calling this method."); //$NON-NLS-1$
|
||||
Assert.isTrue(consoleInfo != null, "consoleInfo must be open with greetings(...) call before using this method."); //$NON-NLS-1$
|
||||
|
||||
//Count Errors/Warnings
|
||||
int errorCount = errorParserManager.getErrorCount();
|
||||
int warningCount = errorParserManager.getWarningCount();
|
||||
|
||||
endTime = System.currentTimeMillis();
|
||||
String duration = durationToString(endTime - startTime);
|
||||
String msg = isCancelled ? CCorePlugin.getFormattedString("BuildRunnerHelper.buildCancelled", duration) //$NON-NLS-1$
|
||||
: CCorePlugin.getFormattedString("BuildRunnerHelper.buildFinished", duration); //$NON-NLS-1$
|
||||
String msg = ""; //$NON-NLS-1$
|
||||
if(isCancelled) {
|
||||
msg = CCorePlugin.getFormattedString("BuildRunnerHelper.buildCancelled", duration); //$NON-NLS-1$
|
||||
} else if(errorCount > 0) {
|
||||
msg = CCorePlugin.getFormattedString("BuildRunnerHelper.buildFailed", new String[] {duration, //$NON-NLS-1$
|
||||
Integer.toString(errorCount), Integer.toString(warningCount)});
|
||||
} else {
|
||||
msg = CCorePlugin.getFormattedString("BuildRunnerHelper.buildFinished", new String[] {duration, //$NON-NLS-1$
|
||||
Integer.toString(errorCount), Integer.toString(warningCount)});
|
||||
}
|
||||
String goodbye = '\n' + timestamp(endTime) + msg + '\n';
|
||||
|
||||
try {
|
||||
|
|
|
@ -98,8 +98,9 @@ BuildRunnerHelper.invokingCommand=Invoking Command: {0}
|
|||
BuildRunnerHelper.refreshingProject=Refreshing resource tree of project {0}
|
||||
BuildRunnerHelper.buildProject={0} of project {1}
|
||||
BuildRunnerHelper.buildProjectConfiguration={0} of configuration {1} for project {2}
|
||||
BuildRunnerHelper.buildFinished=Build Finished (took {0})
|
||||
BuildRunnerHelper.buildCancelled=Build Cancelled (took {0})
|
||||
BuildRunnerHelper.buildFinished=Build Finished. {1} errors, {2} warnings. (took {0})
|
||||
BuildRunnerHelper.buildFailed=Build Failed. {1} errors, {2} warnings. (took {0})
|
||||
BuildRunnerHelper.buildCancelled=Build Cancelled. (took {0})
|
||||
BuildRunnerHelper.build=Build
|
||||
BuildRunnerHelper.incrementalBuild=Incremental Build
|
||||
BuildRunnerHelper.autoBuild=Auto Build
|
||||
|
|
Loading…
Add table
Reference in a new issue