1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Partial implementation of bugzilla 45172: "Add Infos on Build, which Target is being build". There is now a message about the project and configuration being built, along with the type of build, displayed on the console

This commit is contained in:
Sean Evoy 2004-04-06 15:21:18 +00:00
parent d22e72fb14
commit 0d4329b166
2 changed files with 32 additions and 7 deletions

View file

@ -58,7 +58,10 @@ public class GeneratedMakefileBuilder extends ACBuilder {
private static final String START = MESSAGE + ".starting"; //$NON-NLS-1$
private static final String REFRESH = MESSAGE + ".updating"; //$NON-NLS-1$
private static final String MARKERS = MESSAGE + ".creating.markers"; //$NON-NLS-1$
private static final String CONSOLE_HEADER = MESSAGE + ".console.header"; //$NON-NLS-1$
private static final String TYPE_FULL = "ManagedMakeBuilder.type.full"; //$NON-NLS-1$
private static final String TYPE_INC = "ManagedMakeBuider.type.incremental"; //$NON-NLS-1$
// Local variables
protected List resourcesToBuild;
protected List ruleList;
@ -242,14 +245,14 @@ public class GeneratedMakefileBuilder extends ACBuilder {
* @see org.eclipse.cdt.core.resources.ACBuilder#getWorkingDirectory()
*/
public IPath getWorkingDirectory() {
IProject currProject = getProject();
IPath workingDirectory = currProject.getLocation();
return workingDirectory;
return getProject().getLocation();
}
/**
/* (non-Javadoc)
* @param delta
* @param info
* @param monitor
* @throws CoreException
*/
protected void incrementalBuild(IResourceDelta delta, IManagedBuildInfo info, IProgressMonitor monitor) throws CoreException {
// Rebuild the resource tree in the delta
@ -292,6 +295,12 @@ public class GeneratedMakefileBuilder extends ACBuilder {
invokeMake(false, buildDir, info, monitor);
}
/* (non-Javadoc)
* @param fullBuild
* @param buildDir
* @param info
* @param monitor
*/
protected void invokeMake(boolean fullBuild, IPath buildDir, IManagedBuildInfo info, IProgressMonitor monitor) {
// Get the project and make sure there's a monitor to cancel the build
IProject currentProject = getProject();
@ -324,10 +333,23 @@ public class GeneratedMakefileBuilder extends ACBuilder {
monitor.beginTask(ManagedBuilderCorePlugin.getFormattedString(MAKE, msgs), IProgressMonitor.UNKNOWN);
// Get a build console for the project
StringBuffer buf = new StringBuffer();
IConsole console = CCorePlugin.getDefault().getConsole();
console.start(currentProject);
ConsoleOutputStream consoleOutStream = console.getOutputStream();
String[] consoleHeader = new String[3];
consoleHeader[0] = fullBuild ?
ManagedBuilderCorePlugin.getResourceString(TYPE_FULL) :
ManagedBuilderCorePlugin.getResourceString(TYPE_INC);
consoleHeader[1] = info.getConfigurationName();
consoleHeader[2] = currentProject.getName();
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$
buf.append(ManagedBuilderCorePlugin.getFormattedString(CONSOLE_HEADER, consoleHeader));
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$
consoleOutStream.write(buf.toString().getBytes());
consoleOutStream.flush();
// Remove all markers for this project
removeAllMarkers(currentProject);
IProject[] deps = currentProject.getReferencedProjects();
@ -405,7 +427,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
}
// Report either the success or failure of our mission
StringBuffer buf = new StringBuffer();
buf = new StringBuffer();
if (errMsg != null && errMsg.length() > 0) {
String errorDesc = ManagedBuilderCorePlugin.getResourceString(BUILD_ERROR);
buf.append(errorDesc);

View file

@ -16,6 +16,7 @@ ManagedMakeBuilder.message.incremental = Updating makefiles for project {0}
ManagedMakeBuilder.message.updating = Updating project files...
ManagedMakeBuilder.message.make = Calling {0} for project {1}
ManagedMakeBuilder.message.creating.markers = Generating markers...
ManagedMakeBuilder.message.console.header = **** {0} of configuration {1} for project {2} ****
ManagedMakeBuilder.message.error = Build error
ManagedMakeBuilder.message.error.refresh = Error refreshing project
ManagedMakeBuilder.message.finished = Build complete for project {0}
@ -26,6 +27,8 @@ ManagedMakeBuilder.comment.module.make.includes = Include the makefiles for each
ManagedMakeBuilder.comment.module.dep.includes = Include automatically-generated dependency list:
ManagedMakeBuilder.comment.autodeps = Automatically-generated dependency list:
ManagedMakeBuilder.comment.header = Automatically-generated file. Do not edit!
ManagedMakeBuilder.type.full = Full rebuild
ManagedMakeBuider.type.incremental = Incremental build
# Option exception messages
Option.error.bad_value_type=Bad value for type