mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
New build messages to address bugzilla 63410 -- Wrong message is displayed during build
This commit is contained in:
parent
cd4670ee40
commit
77a7513b82
3 changed files with 35 additions and 23 deletions
|
@ -59,10 +59,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
private static final String BUILD_ERROR = MESSAGE + ".error"; //$NON-NLS-1$
|
private static final String BUILD_ERROR = MESSAGE + ".error"; //$NON-NLS-1$
|
||||||
private static final String REFRESH_ERROR = BUILD_ERROR + ".refresh"; //$NON-NLS-1$
|
private static final String REFRESH_ERROR = BUILD_ERROR + ".refresh"; //$NON-NLS-1$
|
||||||
private static final String BUILD_FINISHED = MESSAGE + ".finished"; //$NON-NLS-1$
|
private static final String BUILD_FINISHED = MESSAGE + ".finished"; //$NON-NLS-1$
|
||||||
private static final String INCREMENTAL = MESSAGE + ".incremental"; //$NON-NLS-1$
|
|
||||||
private static final String MAKE = MESSAGE + ".make"; //$NON-NLS-1$
|
private static final String MAKE = MESSAGE + ".make"; //$NON-NLS-1$
|
||||||
private static final String REBUILD = MESSAGE + ".rebuild"; //$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 CONSOLE_HEADER = MESSAGE + ".console.header"; //$NON-NLS-1$
|
||||||
|
@ -103,11 +100,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
* @see org.eclipse.core.internal.events.InternalBuilder#build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
|
* @see org.eclipse.core.internal.events.InternalBuilder#build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
|
||||||
*/
|
*/
|
||||||
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
|
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
|
||||||
String statusMsg = ManagedMakeMessages.getFormattedString(START, getProject().getName());
|
|
||||||
IProject[] deps = getProject().getReferencedProjects();
|
IProject[] deps = getProject().getReferencedProjects();
|
||||||
if (statusMsg != null) {
|
|
||||||
monitor.subTask(statusMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the build information
|
// Get the build information
|
||||||
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject());
|
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject());
|
||||||
|
@ -190,11 +183,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Need to report status to the user
|
|
||||||
String statusMsg = ManagedMakeMessages.getFormattedString(REBUILD, getProject().getName());
|
|
||||||
monitor.subTask(statusMsg);
|
|
||||||
|
|
||||||
// Regenerate the makefiles for this project
|
// Regenerate the makefiles for this project
|
||||||
|
String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.rebuild.makefiles", getProject().getName()); //$NON-NLS-1$
|
||||||
|
monitor.subTask(statusMsg);
|
||||||
String targetID = info.getDefaultTarget().getParent().getId();
|
String targetID = info.getDefaultTarget().getParent().getId();
|
||||||
generator = ManagedBuildManager.getMakefileGenerator(targetID);
|
generator = ManagedBuildManager.getMakefileGenerator(targetID);
|
||||||
generator.initialize(getProject(), info, monitor);
|
generator.initialize(getProject(), info, monitor);
|
||||||
|
@ -204,8 +195,11 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
// Throw the exception back to the builder
|
// Throw the exception back to the builder
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
monitor.worked(1);
|
||||||
|
|
||||||
// Now call make
|
// Now call make
|
||||||
|
statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", getProject().getName()); //$NON-NLS-1$
|
||||||
|
monitor.subTask(statusMsg);
|
||||||
IPath topBuildDir = generator.getBuildWorkingDir();
|
IPath topBuildDir = generator.getBuildWorkingDir();
|
||||||
if (topBuildDir != null) {
|
if (topBuildDir != null) {
|
||||||
invokeMake(true, topBuildDir, info, monitor);
|
invokeMake(true, topBuildDir, info, monitor);
|
||||||
|
@ -213,15 +207,22 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
monitor.done();
|
monitor.done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
monitor.worked(1);
|
||||||
|
|
||||||
// Now regenerate the dependencies
|
// Now regenerate the dependencies
|
||||||
|
statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.regen.deps", getProject().getName()); //$NON-NLS-1$
|
||||||
|
monitor.subTask(statusMsg);
|
||||||
try {
|
try {
|
||||||
generator.regenerateDependencies(false);
|
generator.regenerateDependencies(false);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
// Throw the exception back to the builder
|
// Throw the exception back to the builder
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
monitor.worked(1);
|
||||||
|
|
||||||
|
// Say bye bye
|
||||||
|
statusMsg = ManagedMakeMessages.getFormattedString(BUILD_FINISHED, getProject().getName()); //$NON-NLS-1$
|
||||||
|
monitor.subTask(statusMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -306,15 +307,10 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
* @throws CoreException
|
* @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
|
|
||||||
String statusMsg = null;
|
|
||||||
|
|
||||||
// Need to report status to the user
|
// Need to report status to the user
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
}
|
}
|
||||||
statusMsg = ManagedMakeMessages.getFormattedString(INCREMENTAL, getProject().getName());
|
|
||||||
monitor.subTask(statusMsg);
|
|
||||||
|
|
||||||
// Regenerate the makefiles for any managed projects this project depends on
|
// Regenerate the makefiles for any managed projects this project depends on
|
||||||
IProject[] deps = getProject().getReferencedProjects();
|
IProject[] deps = getProject().getReferencedProjects();
|
||||||
|
@ -336,6 +332,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ask the makefile generator to generate any makefiles needed to build delta
|
// Ask the makefile generator to generate any makefiles needed to build delta
|
||||||
|
String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.update.makefiles", getProject().getName()); //$NON-NLS-1$
|
||||||
|
monitor.subTask(statusMsg);
|
||||||
String targetID = info.getDefaultTarget().getParent().getId();
|
String targetID = info.getDefaultTarget().getParent().getId();
|
||||||
generator = ManagedBuildManager.getMakefileGenerator(targetID);
|
generator = ManagedBuildManager.getMakefileGenerator(targetID);
|
||||||
generator.initialize(getProject(), info, monitor);
|
generator.initialize(getProject(), info, monitor);
|
||||||
|
@ -345,9 +343,12 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
// Throw the exception back to the builder
|
// Throw the exception back to the builder
|
||||||
ManagedBuilderCorePlugin.log(e);
|
ManagedBuilderCorePlugin.log(e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
monitor.worked(1);
|
||||||
|
|
||||||
// Run the build
|
// Run the build
|
||||||
|
statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", getProject().getName());
|
||||||
|
monitor.subTask(statusMsg);
|
||||||
IPath buildDir = new Path(info.getConfigurationName());
|
IPath buildDir = new Path(info.getConfigurationName());
|
||||||
if (buildDir != null) {
|
if (buildDir != null) {
|
||||||
invokeMake(false, buildDir, info, monitor);
|
invokeMake(false, buildDir, info, monitor);
|
||||||
|
@ -355,15 +356,23 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
monitor.done();
|
monitor.done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
monitor.worked(1);
|
||||||
|
|
||||||
// Generate the dependencies for all changes
|
// Generate the dependencies for all changes
|
||||||
|
statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.updating.deps", getProject().getName()); //$NON-NLS-1$
|
||||||
|
monitor.subTask(statusMsg);
|
||||||
try {
|
try {
|
||||||
generator.generateDependencies();
|
generator.generateDependencies();
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
ManagedBuilderCorePlugin.log(e);
|
ManagedBuilderCorePlugin.log(e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
monitor.worked(1);
|
||||||
|
|
||||||
|
// Say bye bye
|
||||||
|
statusMsg = ManagedMakeMessages.getFormattedString(BUILD_FINISHED, getProject().getName()); //$NON-NLS-1$
|
||||||
|
monitor.subTask(statusMsg);
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @param fullBuild
|
* @param fullBuild
|
||||||
|
|
|
@ -11,10 +11,13 @@
|
||||||
|
|
||||||
# Generated makefile builder messages
|
# Generated makefile builder messages
|
||||||
ManagedMakeBuilder.message.starting = Starting the build for project {0}
|
ManagedMakeBuilder.message.starting = Starting the build for project {0}
|
||||||
ManagedMakeBuilder.message.rebuild = Regenerating makefiles for project {0}
|
ManagedMakeBuilder.message.rebuild.makefiles = Regenerating makefiles for project {0}
|
||||||
|
ManagedMakeBuilder.message.update.makefiles = Updating makefiles for project {0}
|
||||||
ManagedMakeBuilder.message.incremental = Updating makefiles for project {0}
|
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.regen.deps = Regenerating dependency files for {0}
|
||||||
|
ManagedMakeBuilder.message.updating.deps = Updating dependency files for {0}
|
||||||
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.console.header = **** {0} of configuration {1} for project {2} ****
|
||||||
ManagedMakeBuilder.message.error = Build error
|
ManagedMakeBuilder.message.error = Build error
|
||||||
|
|
|
@ -680,7 +680,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
protected void appendBuildSubdirectory(IResource resource) {
|
protected void appendBuildSubdirectory(IResource resource) {
|
||||||
IContainer container = resource.getParent();
|
IContainer container = resource.getParent();
|
||||||
if (!getSubdirList().contains(container)) {
|
if (!getSubdirList().contains(container)) {
|
||||||
getSubdirList().add(container);
|
getSubdirList().add(container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1064,7 +1064,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
// Create the file if it does not exist
|
// Create the file if it does not exist
|
||||||
ByteArrayInputStream contents = new ByteArrayInputStream(new byte[0]);
|
ByteArrayInputStream contents = new ByteArrayInputStream(new byte[0]);
|
||||||
try {
|
try {
|
||||||
newFile.create(contents, false, monitor);
|
newFile.create(contents, false, new SubProgressMonitor(monitor, 1));
|
||||||
// Make sure the new file is marked as derived
|
// Make sure the new file is marked as derived
|
||||||
if (!newFile.isDerived()) {
|
if (!newFile.isDerived()) {
|
||||||
newFile.setDerived(true);
|
newFile.setDerived(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue