bug 10674 continuation. Allow SBSv1-style build config names to co-exist with newer SBSv2 configuraiton names that use aliases. This does not use project converstion, just adds the support to differentiate between the two. Also, write new .cproject data to a SBSV2_DATA_ID node (which is not currently read, but to be used for future purposes)
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/ManageConfigurationsDialog.java Fri Apr 02 10:12:34 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/ManageConfigurationsDialog.java Fri Apr 02 15:38:50 2010 -0500
@@ -282,7 +282,21 @@
// if the current config is already a config set it to checked.
ISymbianBuildContext buildContext = (ISymbianBuildContext)currConfigNode.getValue();
for (ICarbideBuildConfiguration currExistingConfig : buildConfigList){
- if (currExistingConfig.equals(buildContext)){
+ boolean checkIt = false;
+ checkIt = currExistingConfig.equals(buildContext);
+ if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(cpi.getProject()) &&
+ !checkIt && currExistingConfig.getSBSv2Alias() == null){
+
+ // extra check to see if we're using SBSv2 and config display name is older SBSv1 style
+ if (buildContext.getTargetString().equals(currExistingConfig.getTargetString()) &&
+ buildContext.getPlatformString().equals(currExistingConfig.getPlatformString()) &&
+ buildContext.getSDK().getUniqueId().equals(currExistingConfig.getSDK().getUniqueId() )
+ && buildContext.getSBSv2Alias() != null && buildContext.getSBSv2Alias().split("_").length == 2){
+
+ checkIt = true;
+ }
+ }
+ if (checkIt){
// must expand parent before checking, otherwise, we won't succeed
properSdkViewer.setExpandedState(sdkNode, true);
properSdkViewer.setChecked(currConfigNode, true);
@@ -359,10 +373,14 @@
// Now find out if it's checked. If it's not checked remove it
if (!properSdkViewer.getChecked(currConfigNode)){
ICarbideBuildConfiguration config = cpm.getNamedConfiguration(buildContext.getDisplayString());
+ if (config == null){
+ config = cpm.getNamedConfiguration(currExistingConfig.getDisplayString());
+ }
if (config != null){
cpm.deleteConfiguration(config);
break;
}
+
}
}
}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Fri Apr 02 10:12:34 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Fri Apr 02 15:38:50 2010 -0500
@@ -61,6 +61,13 @@
protected final static String ARGUMENTS_DATA_ID = "ARGUMENTS_DATA_ID"; //$NON-NLS-1$
protected final static String ROM_BUILDER_DATA_ID = "ROM_BUILDER_DATA_ID"; //$NON-NLS-1$
+ // SBSv2 only config settings
+ protected final static String SBSV2_DATA_ID = "SBSV2_DATA_ID"; //$NON-NLS-1$
+ protected final static String ATRRIB_CONFIG_BASE_PLATFORM = "CONFIG_BASE_PLATFORM"; //$NON-NLS-1$
+ protected final static String ATTRIB_CONFIG_TARGET = "CONFIG_TARGET"; //$NON-NLS-1$
+ protected final static String ATTRIB_SBSV2_BUILD_ALIAS = "SBSV2_BUILD_ALIAS"; //$NON-NLS-1$
+ protected final static String ATTRIB_SBSV2_CONFIG_DISPLAY_STRING = "SBSV2_CONFIG_DISPLAY_STRING"; //$NON-NLS-1$
+
protected TrackedResource projectTracker;
protected List<ISISBuilderInfo> sisBuilderInfoList;
protected EnvironmentVarsInfo2 envVarsInfo;
@@ -118,9 +125,20 @@
envVarsInfo.saveToStorage(rootStorage.createChild(ENV_VAR_DATA_ID));
saveBuildArgsToStorage(rootStorage.createChild(ARGUMENTS_DATA_ID));
romBuilderInfo.saveToStorage(rootStorage.createChild(ROM_BUILDER_DATA_ID));
+
+ if (getSBSv2Alias() != null){
+ saveSBSv2DataToStorage(rootStorage.createChild(SBSV2_DATA_ID));
+ }
}
}
+ private void saveSBSv2DataToStorage(ICStorageElement createChild) {
+ createChild.setAttribute(ATRRIB_CONFIG_BASE_PLATFORM, getPlatformString());
+ createChild.setAttribute(ATTRIB_CONFIG_TARGET, getTargetString());
+ createChild.setAttribute(ATTRIB_SBSV2_BUILD_ALIAS, getSBSv2Alias());
+ createChild.setAttribute(ATTRIB_SBSV2_CONFIG_DISPLAY_STRING, getDisplayString());
+ }
+
private void loadBuildArgsFromStorage(ICStorageElement rootStorage) {
String value = rootStorage.getAttribute(BuildArgumentsInfo.BLDMAKEBLDFILESARGSSTORAGE);
if (value != null) {
@@ -278,9 +296,13 @@
ISymbianBuildContext context = (ISymbianBuildContext)obj;
if (context.getDisplayString().equals(this.getDisplayString())){
return true;
+ } else if (context.getPlatformString().equals(this.getPlatformString()) &&
+ context.getTargetString().equals(this.getTargetString()) &&
+ context.getSDK().equals(this.getSDK()) && context.getSBSv2Alias() != null && context.getSBSv2Alias().split("_").length == 2){
+ return true;
+ } else {
+ return false;
}
- } else {
- return false;
}
return false;
}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv2Builder.java Fri Apr 02 10:12:34 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv2Builder.java Fri Apr 02 15:38:50 2010 -0500
@@ -497,7 +497,10 @@
args.add("-c"); //$NON-NLS-1$
String configName = getConfigName(buildConfig);
if (configName == null){
- configName = "error_retrieving_sbs_config";
+ if (buildConfig.getSBSv2Alias() == null)
+ configName = buildConfig.getPlatformString().toLowerCase() + "_" + buildConfig.getTargetString().toLowerCase();
+ else
+ configName = "error_retrieving_build_alias";
}
if (isTest) {
configName = configName + ".test"; //$NON-NLS-1$
@@ -583,7 +586,10 @@
String configName = getConfigName(buildConfig);
if (configName == null){
- configName = "error_retrieving_sbs_config";
+ if (buildConfig.getSBSv2Alias() == null)
+ configName = buildConfig.getPlatformString().toLowerCase() + "_" + buildConfig.getTargetString().toLowerCase();
+ else
+ configName = "error_retrieving_build_alias";
}
String[] sbsArgs = new String[] {"--source-target=" + file.toOSString(), COMPILE_ARG, configName, COMPONENT_ARG, fullMMPPath.toFile().getName()};
launcher.setErrorParserManager(buildConfig.getCarbideProject().getINFWorkingDirectory(), buildConfig.getErrorParserList());
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/CarbideBuildConfigurationsPage.java Fri Apr 02 10:12:34 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/CarbideBuildConfigurationsPage.java Fri Apr 02 15:38:50 2010 -0500
@@ -508,7 +508,9 @@
String defaultConfigName = cpm.getDefaultBuildConfigName();
if (!selectedConfigString.equals(defaultConfigName)) {
- cpm.setDefaultConfiguration(cpm.getNamedConfiguration(selectedConfigString));
+ if (cpm.getNamedConfiguration(selectedConfigString) != null){
+ cpm.setDefaultConfiguration(cpm.getNamedConfiguration(selectedConfigString));
+ }
cpm.saveChanges();
}