mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
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.
This commit is contained in:
parent
02ba697651
commit
bd35367d7c
6 changed files with 101 additions and 30 deletions
|
@ -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">
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -174,12 +174,16 @@ public class BuildToolSettingsPage extends BuildSettingsPage {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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 @@ public class BuildToolSettingsPage extends BuildSettingsPage {
|
|||
} 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;
|
||||
|
|
Loading…
Add table
Reference in a new issue