mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Patch applied for Leo Treggiari:
1. [Bug 79451] NPEs on project import 2. [Bug 77399] Managed Make Builder mangles subdir.mk if configuration of linked resource was changed fix for initial problem additional problems to be investigated 3. Force rebuild when file build option changes 4. Ensure that converted projects get saved.
This commit is contained in:
parent
f207200fa2
commit
01ad33e1cd
5 changed files with 39 additions and 31 deletions
|
@ -233,8 +233,17 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
|||
public IConfiguration getDefaultConfiguration() {
|
||||
// Get the default config associated with the project
|
||||
if (defaultConfig == null) {
|
||||
if (defaultConfigId != null && managedProject != null) {
|
||||
defaultConfig = managedProject.getConfiguration(defaultConfigId);
|
||||
if (managedProject != null) {
|
||||
if (defaultConfigId != null) {
|
||||
defaultConfig = managedProject.getConfiguration(defaultConfigId);
|
||||
}
|
||||
if (defaultConfig == null) {
|
||||
IConfiguration[] configs = managedProject.getConfigurations();
|
||||
if (configs.length > 0) {
|
||||
defaultConfig = configs[0];
|
||||
defaultConfigId = defaultConfig.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return defaultConfig;
|
||||
|
|
|
@ -46,7 +46,6 @@ public class ResourceConfiguration extends BuildObject implements IResourceConfi
|
|||
private boolean isExtensionResourceConfig = false;
|
||||
private boolean isDirty = false;
|
||||
private boolean resolved = true;
|
||||
private boolean rebuildNeeded = false;
|
||||
|
||||
/*
|
||||
* C O N S T R U C T O R S
|
||||
|
@ -508,7 +507,9 @@ public class ResourceConfiguration extends BuildObject implements IResourceConfi
|
|||
} else {
|
||||
option.setValue(value);
|
||||
}
|
||||
rebuildNeeded = true;
|
||||
// TODO: This causes the entire project to be rebuilt. Is there a way to only have this
|
||||
// file rebuilt? "Clean" its output? Change its modification date?
|
||||
parent.setRebuildState(true);
|
||||
}
|
||||
return retOpt;
|
||||
}
|
||||
|
@ -546,7 +547,9 @@ public class ResourceConfiguration extends BuildObject implements IResourceConfi
|
|||
} else {
|
||||
option.setValue(value);
|
||||
}
|
||||
rebuildNeeded = true;
|
||||
// TODO: This causes the entire project to be rebuilt. Is there a way to only have this
|
||||
// file rebuilt? "Clean" its output? Change its modification date?
|
||||
parent.setRebuildState(true);
|
||||
}
|
||||
return retOpt;
|
||||
}
|
||||
|
@ -607,7 +610,9 @@ public class ResourceConfiguration extends BuildObject implements IResourceConfi
|
|||
} else {
|
||||
option.setValue(value);
|
||||
}
|
||||
rebuildNeeded = true;
|
||||
// TODO: This causes the entire project to be rebuilt. Is there a way to only have this
|
||||
// file rebuilt? "Clean" its output? Change its modification date?
|
||||
parent.setRebuildState(true);
|
||||
}
|
||||
return retOpt;
|
||||
}
|
||||
|
|
|
@ -353,6 +353,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
|||
if (outputExtension != "") //$NON-NLS-1$
|
||||
OptDotExt = DOT + outputExtension;
|
||||
|
||||
IConfiguration config = info.getDefaultConfiguration();
|
||||
|
||||
// We need to check whether we have any resource specific build information.
|
||||
IResourceConfiguration resConfig = null;
|
||||
if( config != null ) resConfig = config.getResourceConfiguration(resource.getFullPath().toString());
|
||||
|
||||
// figure out path to use to resource
|
||||
if(!resourceLocation.toString().startsWith(projectLocation)) {
|
||||
// it IS linked, so use the actual location
|
||||
|
@ -366,26 +372,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
|||
resourcePath = relativePath;
|
||||
|
||||
// The rule and command to add to the makefile
|
||||
buildRule = relativePath + WILDCARD + OptDotExt + COLON + WHITESPACE + ROOT + SEPARATOR + resourcePath + WILDCARD + DOT + inputExtension;
|
||||
} // end fix for PR 70491
|
||||
|
||||
IConfiguration config = info.getDefaultConfiguration();
|
||||
|
||||
// For testing only
|
||||
/* if( config.getResourceConfigurations().length > 0) {
|
||||
IResourceConfiguration[] resConfigs = config.getResourceConfigurations();
|
||||
for (int i = 0; i < resConfigs.length; i++) {
|
||||
System.out.println("Name :" + resConfigs[i].getName());
|
||||
if( resConfig != null) {
|
||||
buildRule = resourcePath + resourceName + OptDotExt + COLON + WHITESPACE + ROOT + SEPARATOR + resourcePath + resourceName + DOT + inputExtension;
|
||||
} else {
|
||||
buildRule = relativePath + WILDCARD + OptDotExt + COLON + WHITESPACE + ROOT + SEPARATOR + resourcePath + WILDCARD + DOT + inputExtension;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// We need to check whether we have any resource specific build information.
|
||||
IResourceConfiguration resConfig = null;
|
||||
if( config != null ) resConfig = config.getResourceConfiguration(resource.getFullPath().toString());
|
||||
if( resConfig != null) {
|
||||
buildRule = resourcePath + resourceName + OptDotExt + COLON + WHITESPACE + "$(ROOT)/" + resourcePath + resourceName + DOT + inputExtension; //$NON-NLS-1$
|
||||
}
|
||||
} // end fix for PR 70491
|
||||
|
||||
// No duplicates in a makefile
|
||||
if (getRuleList().contains(buildRule)) {
|
||||
|
@ -409,14 +401,15 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
|||
outflag = tools[0].getOutputFlag();
|
||||
outputPrefix = tools[0].getOutputPrefix();
|
||||
cmd = tools[0].getToolCommand();
|
||||
// The command to build
|
||||
// The command to build
|
||||
|
||||
String fileName;
|
||||
String rootDir = "../"; //$NON-NLS-1$
|
||||
if (isItLinked)
|
||||
if (isItLinked) {
|
||||
fileName = resourcePath;
|
||||
else
|
||||
} else {
|
||||
fileName = rootDir + relativePath + resConfig.getName();
|
||||
}
|
||||
|
||||
inputs = new String[1]; inputs[0] = fileName;
|
||||
String[] flags = null;
|
||||
|
@ -428,10 +421,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
|||
}
|
||||
IManagedCommandLineGenerator cmdLGen = tools[0].getCommandLineGenerator();
|
||||
cmdLInfo = cmdLGen.generateCommandLineInfo( tools[0], cmd, flags, outflag, outputPrefix,
|
||||
resourcePath + resourceName + OptDotExt, inputs, tools[0].getCommandLinePattern() );
|
||||
OUT_MACRO, inputs, tools[0].getCommandLinePattern() );
|
||||
|
||||
String buildCmd = cmdLInfo.getCommandLine();
|
||||
// String buildCmd = cmd + WHITESPACE + buildFlags + WHITESPACE + outflag + WHITESPACE + outputPrefix + resourceName + OptDotExt + WHITESPACE + fileName;
|
||||
buffer.append(TAB + AT + ECHO + WHITESPACE + buildCmd + NEWLINE);
|
||||
buffer.append(TAB + AT + buildCmd);
|
||||
} else {
|
||||
|
|
|
@ -612,6 +612,7 @@ class UpdateManagedProject12 {
|
|||
|
||||
// Upgrade the version
|
||||
((ManagedBuildInfo)info).setVersion(ManagedBuildManager.getBuildInfoVersion().toString());
|
||||
info.setValid(true);
|
||||
}catch (CoreException e){
|
||||
throw e;
|
||||
}catch (Exception e) {
|
||||
|
|
|
@ -89,6 +89,7 @@ class UpdateManagedProject20 {
|
|||
}
|
||||
// Upgrade the version
|
||||
((ManagedBuildInfo)info).setVersion(ManagedBuildManager.getBuildInfoVersion().toString());
|
||||
info.setValid(true);
|
||||
}catch (CoreException e){
|
||||
throw e;
|
||||
}catch (Exception e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue