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:
parent
d22e72fb14
commit
0d4329b166
2 changed files with 32 additions and 7 deletions
|
@ -58,6 +58,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
private static final String START = MESSAGE + ".starting"; //$NON-NLS-1$
|
private static final String START = MESSAGE + ".starting"; //$NON-NLS-1$
|
||||||
private static final String REFRESH = MESSAGE + ".updating"; //$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 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
|
// Local variables
|
||||||
protected List resourcesToBuild;
|
protected List resourcesToBuild;
|
||||||
|
@ -242,14 +245,14 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
* @see org.eclipse.cdt.core.resources.ACBuilder#getWorkingDirectory()
|
* @see org.eclipse.cdt.core.resources.ACBuilder#getWorkingDirectory()
|
||||||
*/
|
*/
|
||||||
public IPath getWorkingDirectory() {
|
public IPath getWorkingDirectory() {
|
||||||
IProject currProject = getProject();
|
return getProject().getLocation();
|
||||||
IPath workingDirectory = currProject.getLocation();
|
|
||||||
return workingDirectory;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* @param delta
|
* @param delta
|
||||||
|
* @param info
|
||||||
* @param monitor
|
* @param monitor
|
||||||
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
protected void incrementalBuild(IResourceDelta delta, IManagedBuildInfo info, IProgressMonitor monitor) throws CoreException {
|
protected void incrementalBuild(IResourceDelta delta, IManagedBuildInfo info, IProgressMonitor monitor) throws CoreException {
|
||||||
// Rebuild the resource tree in the delta
|
// Rebuild the resource tree in the delta
|
||||||
|
@ -292,6 +295,12 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
invokeMake(false, buildDir, info, monitor);
|
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) {
|
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
|
// Get the project and make sure there's a monitor to cancel the build
|
||||||
IProject currentProject = getProject();
|
IProject currentProject = getProject();
|
||||||
|
@ -324,9 +333,22 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
monitor.beginTask(ManagedBuilderCorePlugin.getFormattedString(MAKE, msgs), IProgressMonitor.UNKNOWN);
|
monitor.beginTask(ManagedBuilderCorePlugin.getFormattedString(MAKE, msgs), IProgressMonitor.UNKNOWN);
|
||||||
|
|
||||||
// Get a build console for the project
|
// Get a build console for the project
|
||||||
|
StringBuffer buf = new StringBuffer();
|
||||||
IConsole console = CCorePlugin.getDefault().getConsole();
|
IConsole console = CCorePlugin.getDefault().getConsole();
|
||||||
console.start(currentProject);
|
console.start(currentProject);
|
||||||
ConsoleOutputStream consoleOutStream = console.getOutputStream();
|
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
|
// Remove all markers for this project
|
||||||
removeAllMarkers(currentProject);
|
removeAllMarkers(currentProject);
|
||||||
|
@ -405,7 +427,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Report either the success or failure of our mission
|
// Report either the success or failure of our mission
|
||||||
StringBuffer buf = new StringBuffer();
|
buf = new StringBuffer();
|
||||||
if (errMsg != null && errMsg.length() > 0) {
|
if (errMsg != null && errMsg.length() > 0) {
|
||||||
String errorDesc = ManagedBuilderCorePlugin.getResourceString(BUILD_ERROR);
|
String errorDesc = ManagedBuilderCorePlugin.getResourceString(BUILD_ERROR);
|
||||||
buf.append(errorDesc);
|
buf.append(errorDesc);
|
||||||
|
|
|
@ -16,6 +16,7 @@ ManagedMakeBuilder.message.incremental = Updating makefiles for project {0}
|
||||||
ManagedMakeBuilder.message.updating = Updating project files...
|
ManagedMakeBuilder.message.updating = Updating project files...
|
||||||
ManagedMakeBuilder.message.make = Calling {0} for project {1}
|
ManagedMakeBuilder.message.make = Calling {0} for project {1}
|
||||||
ManagedMakeBuilder.message.creating.markers = Generating markers...
|
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 = Build error
|
||||||
ManagedMakeBuilder.message.error.refresh = Error refreshing project
|
ManagedMakeBuilder.message.error.refresh = Error refreshing project
|
||||||
ManagedMakeBuilder.message.finished = Build complete for project {0}
|
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.module.dep.includes = Include automatically-generated dependency list:
|
||||||
ManagedMakeBuilder.comment.autodeps = Automatically-generated dependency list:
|
ManagedMakeBuilder.comment.autodeps = Automatically-generated dependency list:
|
||||||
ManagedMakeBuilder.comment.header = Automatically-generated file. Do not edit!
|
ManagedMakeBuilder.comment.header = Automatically-generated file. Do not edit!
|
||||||
|
ManagedMakeBuilder.type.full = Full rebuild
|
||||||
|
ManagedMakeBuider.type.incremental = Incremental build
|
||||||
|
|
||||||
# Option exception messages
|
# Option exception messages
|
||||||
Option.error.bad_value_type=Bad value for type
|
Option.error.bad_value_type=Bad value for type
|
||||||
|
|
Loading…
Add table
Reference in a new issue