Skip to main content

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

Attached are patches for MBS Core, Tests, and UI.

 

This patch contains fixes for the following MBS bugzillas:

 

Fixed:

44568 - [Managed Build] -Xlinker option requires space separator

80119 - [Managed Build] Error in the Xlinker option's generated output

 

The code and the manifest file have been changed to correctly deal with

the -Xlinker option.  Multiple entries have separate -Xlinker options,

and there is a space between -Xlinker and the value.  The space is

handled by the new option.command functionality - "${VALUE}".

 

77399 - Managed Make Builder mangles subdir.mk if configuration of

        linked resource was changed

 

This was partially fixed before and was partially a user error.

Code has been added to output an error message to the console when

MBS sees a duplicate identifier in the loaded manifest files.

 

Partial fix:

80067 - [Managed Build] Wrong command for building in MMS

 

A fix has been added so that a command is not stored with a Tool

unless the user changes the value - i.e the Tool will inherit the

value from its suoer-class.  There is still an error with the Gnu

makefile generator when a configuration tool and a resource

configuration tool have different commands specified by the user.

This will be fixed later.

 

Thanks,

Leo

 

Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/plugin.xml,v
retrieving revision 1.42
diff -u -r1.42 plugin.xml
--- plugin.xml	28 Oct 2004 17:16:34 -0000	1.42
+++ plugin.xml	5 Dec 2004 02:36:28 -0000
@@ -187,7 +187,7 @@
          <option
                name="%Option.Posix.Linker.XLinker"
                category="gnu.c.link.category.other"
-               command="-Xlinker,"
+               command="-Xlinker ${VALUE}"
                valueType="stringList"
                id="gnu.c.link.option.other">
          </option>
@@ -314,7 +314,7 @@
          <option
                name="%Option.Posix.Linker.XLinker"
                category="gnu.cpp.link.category.other"
-               command="-Xlinker "
+               command="-Xlinker ${VALUE}"
                valueType="stringList"
                id="gnu.cpp.link.option.other">
          </option>
@@ -575,7 +575,7 @@
          <option
                name="%Option.Posix.Linker.XLinker"
                category="macosx.c.link.category.other"
-               command="-Xlinker,"
+               command="-Xlinker ${VALUE}"
                valueType="stringList"
                id="macosx.c.link.option.other">
          </option>
@@ -680,7 +680,7 @@
          <option
                name="%Option.Posix.Linker.XLinker"
                category="macosx.cpp.link.category.other"
-               command="-Xlinker "
+               command="-Xlinker ${VALUE}"
                valueType="stringList"
                id="macosx.cpp.link.option.other">
          </option>
@@ -1576,7 +1576,7 @@
 		              archList="all">
 		          </targetPlatform>
 				  <builder
-				      id="cdt.managedbuild.target.gnu.builder.lib.debug"
+				      id="cdt.managedbuild.target.gnu.builder.lib.release"
 		              name="%BuilderName.Rel"
 		              command="make"
 		              arguments="-k"
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java,v
retrieving revision 1.15
diff -u -r1.15 BuildToolSettingsPage.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java	28 Oct 2004 17:16:33 -0000	1.15
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java	5 Dec 2004 02:36:29 -0000
@@ -174,12 +174,16 @@
 	}
 	
 	/**
-	 * Look for $(VALUE) in the command string
+	 * Look for ${VALUE} in the command string
 	 */
 	private String evaluateCommand( String command, String values ) {
 	    if( command == null ) return values.trim();
-	    if( command.indexOf( "$(" ) > 0 ) return command.replaceAll( "\\$\\([value|Value|VALUE]\\)", values.trim() ).trim(); //$NON-NLS-1$ //$NON-NLS-2$
-	    else return (new String(command + values)).trim();
+	    if( command.indexOf( "${" ) >= 0 ) {	//$NON-NLS-1$ 
+	    	return command.replaceAll( "\\$\\{[vV][aA][lL][uU][eE]\\}", values.trim() ).trim(); //$NON-NLS-1$
+	    }
+	    else {
+	    	return (new String(command + values)).trim();
+	    }
 	}
 
 	/**
@@ -544,17 +548,16 @@
 			} catch (BuildException e) {}
 		}
 		
+		// Save the tool command if it has changed
 		// Get the actual value out of the field editor
 		String command = getToolSettingsPreferenceStore().getString(tool.getId());
-		if (command.length() == 0) {
-			return result;
-		}
-		
-		// Ask the build system manager to change the tool command
-		if ( isItResourceConfigPage ) {
-			ManagedBuildManager.setToolCommand(resConfig, tool, command);
-		} else {
-			ManagedBuildManager.setToolCommand(configuration, tool, command);
+		if (command.length() > 0 &&
+			(!command.equals(tool.getToolCommand()))) {
+			if ( isItResourceConfigPage ) {
+				ManagedBuildManager.setToolCommand(resConfig, tool, command);
+			} else {
+				ManagedBuildManager.setToolCommand(configuration, tool, command);
+			}
 		}
 		
 		return result;
Index: src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java,v
retrieving revision 1.32.2.1
diff -u -r1.32.2.1 ManagedBuildManager.java
--- src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java	22 Nov 2004 21:18:12 -0000	1.32.2.1
+++ src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java	5 Dec 2004 02:35:19 -0000
@@ -108,6 +108,7 @@
 	private static final String PROJECT_VERSION_ERROR ="ManagedBuildManager.error.project.version.error";	//$NON-NLS-1$
 	private static final String MANIFEST_ERROR_HEADER = "ManagedBuildManager.error.manifest.header";	//$NON-NLS-1$
 	public  static final String MANIFEST_ERROR_RESOLVING = "ManagedBuildManager.error.manifest.resolving";	//$NON-NLS-1$
+	public  static final String MANIFEST_ERROR_DUPLICATE = "ManagedBuildManager.error.manifest.duplicate";	//$NON-NLS-1$
 	private static final String NEWLINE = System.getProperty("line.separator");	//$NON-NLS-1$
 	
 	// This is the version of the manifest and project files that
@@ -914,7 +915,13 @@
 		}
 		
 		projectTypes.add(projectType);
-		getExtensionProjectTypeMap().put(projectType.getId(), projectType);
+		Object previous = getExtensionProjectTypeMap().put(projectType.getId(), projectType);
+		if (previous != null) {
+			// Report error
+			ManagedBuildManager.OutputDuplicateIdError(
+					"ProjectType",	//$NON-NLS-1$
+					projectType.getId());			
+		}
 	}
 	
 	/**
@@ -925,7 +932,13 @@
 	 * @param configuration 
 	 */
 	public static void addExtensionConfiguration(Configuration configuration) {
-		getExtensionConfigurationMap().put(configuration.getId(), configuration);
+		Object previous = getExtensionConfigurationMap().put(configuration.getId(), configuration);
+		if (previous != null) {
+			// Report error
+			ManagedBuildManager.OutputDuplicateIdError(
+					"Configuration",	//$NON-NLS-1$
+					configuration.getId());			
+		}
 	}
 	
 	/**
@@ -936,7 +949,13 @@
 	 * @param resourceConfiguration 
 	 */
 	public static void addExtensionResourceConfiguration(ResourceConfiguration resourceConfiguration) {
-		getExtensionResourceConfigurationMap().put(resourceConfiguration.getId(), resourceConfiguration);
+		Object previous = getExtensionResourceConfigurationMap().put(resourceConfiguration.getId(), resourceConfiguration);
+		if (previous != null) {
+			// Report error
+			ManagedBuildManager.OutputDuplicateIdError(
+					"ResourceConfiguration",	//$NON-NLS-1$
+					resourceConfiguration.getId());			
+		}
 	}
 	
 	/**
@@ -947,7 +966,13 @@
 	 * @param toolChain 
 	 */
 	public static void addExtensionToolChain(ToolChain toolChain) {
-		getExtensionToolChainMap().put(toolChain.getId(), toolChain);
+		Object previous = getExtensionToolChainMap().put(toolChain.getId(), toolChain);
+		if (previous != null) {
+			// Report error
+			ManagedBuildManager.OutputDuplicateIdError(
+					"ToolChain",	//$NON-NLS-1$
+					toolChain.getId());			
+		}
 	}
 		
 	/**
@@ -960,7 +985,13 @@
 	 * @param tool
 	 */
 	public static void addExtensionTool(Tool tool) {
-		getExtensionToolMap().put(tool.getId(), tool);
+		Object previous = getExtensionToolMap().put(tool.getId(), tool);
+		if (previous != null) {
+			// Report error
+			ManagedBuildManager.OutputDuplicateIdError(
+					"Tool",	//$NON-NLS-1$
+					tool.getId());			
+		}
 	}
 	
 	/**
@@ -971,7 +1002,13 @@
 	 * @param targetPlatform 
 	 */
 	public static void addExtensionTargetPlatform(TargetPlatform targetPlatform) {
-		getExtensionTargetPlatformMap().put(targetPlatform.getId(), targetPlatform);
+		Object previous = getExtensionTargetPlatformMap().put(targetPlatform.getId(), targetPlatform);
+		if (previous != null) {
+			// Report error
+			ManagedBuildManager.OutputDuplicateIdError(
+					"TargetPlatform",	//$NON-NLS-1$
+					targetPlatform.getId());			
+		}
 	}
 	
 	/**
@@ -982,7 +1019,13 @@
 	 * @param Builder 
 	 */
 	public static void addExtensionBuilder(Builder builder) {
-		getExtensionBuilderMap().put(builder.getId(), builder);
+		Object previous = getExtensionBuilderMap().put(builder.getId(), builder);
+		if (previous != null) {
+			// Report error
+			ManagedBuildManager.OutputDuplicateIdError(
+					"Builder",	//$NON-NLS-1$
+					builder.getId());			
+		}
 	}
 	
 	/**
@@ -993,7 +1036,13 @@
 	 * @param option 
 	 */
 	public static void addExtensionOption(Option option) {
-		getExtensionOptionMap().put(option.getId(), option);
+		Object previous = getExtensionOptionMap().put(option.getId(), option);
+		if (previous != null) {
+			// Report error
+			ManagedBuildManager.OutputDuplicateIdError(
+					"Option",	//$NON-NLS-1$
+					option.getId());			
+		}
 	}
 	
 	/**
@@ -1004,7 +1053,13 @@
 	 * @param optionCategory 
 	 */
 	public static void addExtensionOptionCategory(OptionCategory optionCategory) {
-		getExtensionOptionCategoryMap().put(optionCategory.getId(), optionCategory);
+		Object previous = getExtensionOptionCategoryMap().put(optionCategory.getId(), optionCategory);
+		if (previous != null) {
+			// Report error
+			ManagedBuildManager.OutputDuplicateIdError(
+					"OptionCategory",	//$NON-NLS-1$
+					optionCategory.getId());			
+		}
 	}
 	
 	/**
@@ -1875,6 +1930,14 @@
 		msgs[3] = id;
 		ManagedBuildManager.OutputManifestError(
 			ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_RESOLVING, msgs));
+	}
+	
+	public static void OutputDuplicateIdError(String type, String id) {
+		String[] msgs = new String[2];
+		msgs[0] = type;
+		msgs[1] = id;
+		ManagedBuildManager.OutputManifestError(
+			ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_DUPLICATE, msgs));
 	}
 	
 	public static void OutputManifestError(String message) {
Index: src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties,v
retrieving revision 1.20.2.1
diff -u -r1.20.2.1 PluginResources.properties
--- src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties	22 Nov 2004 21:18:12 -0000	1.20.2.1
+++ src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties	5 Dec 2004 02:35:19 -0000
@@ -39,8 +39,9 @@
 ManagedBuildManager.error.owner_not_project=addTarget: owner not project
 ManagedBuildManager.error.manifest_load_failed_title=Managed Build System Version Error
 ManagedBuildManager.error.manifest.version.error=The version number defined in the plugin manifest file\n{0}\nis greater than the version of the Managed Build System.\nThe definitions in the manifest file will not be loaded.
-ManagedBuildManager.error.manifest.header=Manifest file error: 
+ManagedBuildManager.error.manifest.header=Managed Build system manifest file error: 
 ManagedBuildManager.error.manifest.resolving=Unable to resolve the {0} identifier {1} in the {2} {3}.
+ManagedBuildManager.error.manifest.duplicate=Duplicate identifier {1} for element type {0}.
 ManagedBuildManager.error.open_failed_title=Managed Make Project File Error
 ManagedBuildManager.error.open_failed=The Managed Make project file could not be read because of the following error.\n\n{0}\n\nManaged Make functionality will not be available for this project.
 ManagedBuildManager.error.project.version.error=The version number of the project {0} is greater than the Managed Build System version number.
Index: src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java,v
retrieving revision 1.20.2.1
diff -u -r1.20.2.1 Tool.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java	22 Nov 2004 21:18:12 -0000	1.20.2.1
+++ src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java	5 Dec 2004 02:35:21 -0000
@@ -1526,7 +1526,11 @@
 	
 	private String evaluateCommand( String command, String values ) {
 	    if( command == null ) return values.trim();
-	    if( command.indexOf( "$(" ) > 0 ) return command.replaceAll( "\\$\\([value|Value|VALUE]\\)", values.trim() ).trim(); //$NON-NLS-1$ //$NON-NLS-2$
-	    else return (new String(command + values)).trim();
+	    if( command.indexOf( "${" ) >= 0 ) { //$NON-NLS-1$
+	    	return command.replaceAll("\\$\\{[vV][aA][lL][uU][eE]\\}", values.trim() ).trim(); //$NON-NLS-1$
+	    }
+	    else {
+	    	return (new String(command + values)).trim();
+	    }
 	}
 }
Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml,v
retrieving revision 1.11
diff -u -r1.11 plugin.xml
--- plugin.xml	15 Nov 2004 19:33:09 -0000	1.11
+++ plugin.xml	5 Dec 2004 02:36:00 -0000
@@ -1599,7 +1599,7 @@
 		              archList="all">
 		          </targetPlatform>
 				  <builder
-				      id="cdt.managedbuild.target.testgnu.builder.lib.debug"
+				      id="cdt.managedbuild.target.testgnu.builder.lib.release"
 		              name="Rel B"
 		              command="make"
 		              arguments="-k">

Back to the top