Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] MBS Patch for 2.1 & Head

This patch contains bug fixes for CDT 2.1, and should also be applied to Head.

 

The fixes are for:

1. [Bug 79451] [MBS] 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.

 

Thanks,

Leo

 

Index: src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java,v
retrieving revision 1.29.2.1
diff -u -r1.29.2.1 ManagedBuildInfo.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java	26 Nov 2004 18:18:42 -0000	1.29.2.1
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java	26 Nov 2004 21:14:03 -0000
@@ -233,8 +233,17 @@
 	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;
Index: src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java,v
retrieving revision 1.1
diff -u -r1.1 ResourceConfiguration.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java	28 Oct 2004 17:16:53 -0000	1.1
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java	26 Nov 2004 21:14:03 -0000
@@ -46,8 +46,7 @@
 	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 @@
 			} 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 @@
 			} 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 @@
 			} 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;
 	}
Index: src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java,v
retrieving revision 1.25
diff -u -r1.25 GnuMakefileGenerator.java
--- src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java	8 Nov 2004 20:12:37 -0000	1.25
+++ src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java	26 Nov 2004 21:14:06 -0000
@@ -352,6 +352,12 @@
 		
 		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)) {
@@ -366,26 +372,12 @@
 			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 @@
 			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 @@
 			}
 			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 {
Index: src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 UpdateManagedProject12.java
--- src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java	26 Nov 2004 18:18:42 -0000	1.1.2.1
+++ src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java	26 Nov 2004 21:14:07 -0000
@@ -612,6 +612,7 @@
 			
 			// Upgrade the version
 			((ManagedBuildInfo)info).setVersion(ManagedBuildManager.getBuildInfoVersion().toString());
+			info.setValid(true);
 		}catch (CoreException e){
 			throw e;
 		}catch (Exception e) {
Index: src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java,v
retrieving revision 1.1
diff -u -r1.1 UpdateManagedProject20.java
--- src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java	28 Oct 2004 17:16:53 -0000	1.1
+++ src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java	26 Nov 2004 21:14:07 -0000
@@ -89,6 +89,7 @@
 			}
 			// Upgrade the version
 			((ManagedBuildInfo)info).setVersion(ManagedBuildManager.getBuildInfoVersion().toString());
+			info.setValid(true);
 		}catch (CoreException e){
 			throw e;
 		}catch (Exception e) {

Back to the top