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

Apply patch for Bugzilla 123302 - NPE in ErrorParserManager during build

Apply patch for Bugzilla 123497 - Project with multiple dependencies fails to build: "no rule for target"
Fix problem with tool 'copy' constructor not copying commandLinePattern
Fix bugzilla 117311 - QT / MOC compiler and CDT
This commit is contained in:
Leo Treggiari 2006-01-17 00:42:42 +00:00
parent e600743f89
commit 636fd2d51a
3 changed files with 31 additions and 26 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2005 IBM Corporation and others.
* Copyright (c) 2002, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -369,6 +369,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
if (refDelta == null) {
outputTrace(getProject().getName(), "Incremental build because of changed referenced project"); //$NON-NLS-1$
incrementalBuild(delta, info, generator, monitor);
// Should only build this project once, for this delta
break;
} else {
int refKind = refDelta.getKind();
if (refKind != IResourceDelta.NO_CHANGE) {
@ -377,6 +379,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
refFlags == IResourceDelta.OPEN)) {
outputTrace(getProject().getName(), "Incremental build because of changed referenced project"); //$NON-NLS-1$
incrementalBuild(delta, info, generator, monitor);
// Should only build this project once, for this delta
break;
}
}
}
@ -794,8 +798,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
String[] errorParsers = info.getDefaultConfiguration().getErrorParserList();
ErrorParserManager epm = new ErrorParserManager(getProject(), workingDirectory, this, errorParsers);
epm.setOutputStream(consoleOutStream);
OutputStream stdout = epm.getOutputStream();
OutputStream stderr = epm.getOutputStream();
// This variable is necessary to ensure that the EPM stream stay open
// until we explicitly close it. See bug#123302.
OutputStream epmOutputStream = epm.getOutputStream();
// Get the arguments to be passed to make from build model
ArrayList makeArgs = new ArrayList();
@ -844,7 +849,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
proc.getOutputStream().close();
} catch (IOException e) {
}
if (launcher.waitAndRead(stdout, stderr,
if (launcher.waitAndRead(epm.getOutputStream(), epm.getOutputStream(),
new SubProgressMonitor(monitor,
IProgressMonitor.UNKNOWN)) != CommandLauncher.OK) {
errMsg = launcher.getErrorMessage();
@ -873,9 +878,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Write message on the console
consoleOutStream.write(buf.toString().getBytes());
consoleOutStream.flush();
epmOutputStream.close();
consoleOutStream.close();
stdout.close();
stderr.close();
} else {
// The status value was other than 0, so press on with the build process
makeArgs.add("pre-build"); //$NON-NLS-1$
@ -915,7 +919,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
} catch (IOException e) {
}
if (launcher.waitAndRead(stdout, stderr,
if (launcher.waitAndRead(epm.getOutputStream(), epm.getOutputStream(),
new SubProgressMonitor(monitor,
IProgressMonitor.UNKNOWN)) != CommandLauncher.OK) {
errMsg = launcher.getErrorMessage();
@ -957,8 +961,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Write message on the console
consoleOutStream.write(buf.toString().getBytes());
consoleOutStream.flush();
stdout.close();
stderr.close();
epmOutputStream.close();
// Generate any error markers that the build has discovered
monitor.subTask(ManagedMakeMessages

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2003, 2005 IBM Corporation and others.
* Copyright (c) 2003, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -335,6 +335,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
if (tool.command != null) {
command = new String(tool.command);
}
if (tool.commandLinePattern != null) {
commandLinePattern = new String(tool.commandLinePattern);
}
if (tool.inputExtensions != null) {
inputExtensions = new ArrayList(tool.inputExtensions);
}

View file

@ -2056,29 +2056,28 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
*/
protected void addToBuildVar (LinkedHashMap buildVarToRuleStringMap, String ext,
String varName, String relativePath, IPath sourceLocation, boolean generatedSource) {
// look for the extension in the map
List varList = null;
if (varName == null) {
// Get the proper source build variable based upon the extension
varName = getSourceMacroName(ext).toString();
// Add the resource to the list of all resources associated with a variable.
List varList = (List)buildSrcVars.get(varName);
varList = (List)buildSrcVars.get(varName);
} else {
varList = (List)buildOutVars.get(varName);
}
// Add the resource to the list of all resources associated with a variable.
// Do not allow duplicates - there is no reason to and it can be 'bad' -
// e.g., having the same object in the OBJS list can cause duplicate symbol errors from the linker
if ((varList != null) && !(varList.contains(sourceLocation))) {
// Since we don't know how these files will be used, we store them using a "location"
// path rather than a relative path
varList.add(sourceLocation);
} else {
// Add the resource to the list of all resources associated with a variable.
List varList = (List)buildOutVars.get(varName);
if (varList != null) {
// Since we don't know how these files will be used, we store them using a "location"
// path rather than a relative path
varList.add(sourceLocation);
if (!buildVarToRuleStringMap.containsKey(varName)) {
// TODO - is this an error?
} else {
// Add the resource name to the makefile line that adds resources to the build variable
addMacroAdditionFile(buildVarToRuleStringMap, varName, relativePath, sourceLocation, generatedSource);
}
}
if (!buildVarToRuleStringMap.containsKey(varName)) {
// TODO - is this an error?
} else {
// Add the resource name to the makefile line that adds resources to the build variable
addMacroAdditionFile(buildVarToRuleStringMap, varName, relativePath, sourceLocation, generatedSource);
}
}
/* (non-Javadoc)