Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Evoy2004-12-07 15:12:00 +0000
committerSean Evoy2004-12-07 15:12:00 +0000
commitbd35367d7c48875b57b6390902e7b72247dcf098 (patch)
treeac0c9e87f96b77022c6ba2379c14db7331826fcf /build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt
parent02ba697651ef3a199d9d96f8b07ebcf439d33822 (diff)
downloadorg.eclipse.cdt-bd35367d7c48875b57b6390902e7b72247dcf098.tar.gz
org.eclipse.cdt-bd35367d7c48875b57b6390902e7b72247dcf098.tar.xz
org.eclipse.cdt-bd35367d7c48875b57b6390902e7b72247dcf098.zip
Commit for Leo Treggiari:
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.
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java81
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java8
3 files changed, 80 insertions, 12 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
index 329b4831236..ccfa4642673 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
@@ -108,6 +108,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
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 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
}
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 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
* @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 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
* @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 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
* @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 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
* @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 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
* @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 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
* @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 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
* @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 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
* @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());
+ }
}
/**
@@ -1877,6 +1932,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
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) {
System.err.println(ManagedMakeMessages.getResourceString(MANIFEST_ERROR_HEADER) + message + NEWLINE);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
index 0ce1deedc05..114d4f610e9 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
@@ -39,8 +39,9 @@ ManagedBuildManager.error.null_owner=addTarget: null owner
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.
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
index 6a84efb03c5..cef6eefb0c1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
@@ -1526,7 +1526,11 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
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();
+ }
}
}

Back to the top