Fix bug 11210. NPEs when editing SBSv2 config tab data on old SBSv2 build configs.
Now allows saving SBSv2 variant data for old SBSv2 configs
(i.e. before we display the build alias in the config name)
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Mon May 03 15:57:15 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Tue May 04 09:39:10 2010 -0500
@@ -81,7 +81,7 @@
buildArgumentsInfo = new BuildArgumentsInfo(getSDK());
buildConfigData = new BuildConfigurationData(this);
romBuilderInfo = new ROMBuilderInfo(getSDK());
- if (context.getSBSv2Alias() != null){
+ if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(project)){
sbsv2BuilderInfo = new SBSv2BuilderInfo(context);
}
rebuildNeeded = true;
@@ -131,7 +131,7 @@
saveBuildArgsToStorage(rootStorage.createChild(ARGUMENTS_DATA_ID));
romBuilderInfo.saveToStorage(rootStorage.createChild(ROM_BUILDER_DATA_ID));
- if (getSBSv2Alias() != null){
+ if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(getCarbideProject().getProject())){
sbsv2BuilderInfo.saveToStorage(rootStorage.createChild(SBSV2_DATA_ID));
}
}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv2Builder.java Mon May 03 15:57:15 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv2Builder.java Tue May 04 09:39:10 2010 -0500
@@ -93,6 +93,10 @@
/** Get the build-able configuration from the command line (i.e. build alias). This is passed after the sbs -c parameter */
protected String getConfigName(ICarbideBuildConfiguration buildConfig) {
String buildAlias = buildConfig.getSBSv2Alias();
+ if (buildAlias == null){
+ // Just get the default target. This is a SBSv1 style configuration name...
+ buildAlias = buildConfig.getPlatformString().toLowerCase() + "_" + buildConfig.getTargetString().toLowerCase();
+ }
ISBSv2BuildConfigInfo sbsv2Info = ((CarbideBuildConfiguration)buildConfig).getSBSv2BuildConfigInfo();
if (sbsv2Info != null){
String variant = sbsv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT);
@@ -508,13 +512,7 @@
args.add(cpi.getAbsoluteBldInfPath().toOSString());
args.add("-c"); //$NON-NLS-1$
String configName = getConfigName(buildConfig);
- if (configName == null){
- // Just get the default target. This is a SBSv1 style configuration name...
- 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$
}
@@ -593,13 +591,6 @@
IPath workingDirectory = cpi.getINFWorkingDirectory();
String configName = getConfigName(buildConfig);
- if (configName == null){
- // Just get the default target. This is a SBSv1 style configuration name...
- 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/SBSv2BuilderInfo.java Mon May 03 15:57:15 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/SBSv2BuilderInfo.java Tue May 04 09:39:10 2010 -0500
@@ -32,7 +32,8 @@
ISymbianBuildContext context;
public SBSv2BuilderInfo(ISymbianBuildContext context) {
- sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_BUILD_ALIAS, context.getSBSv2Alias());
+ String buildAlias = context.getSBSv2Alias() != null ? context.getSBSv2Alias() : "";
+ sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_BUILD_ALIAS, buildAlias);
sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATRRIB_CONFIG_BASE_PLATFORM, context.getBasePlatformForVariation());
sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATTRIB_CONFIG_TARGET, context.getTargetString());
sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_CONFIG_DISPLAY_STRING, context.getDisplayString());
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/SBSv2BuildConfigTabComposite.java Mon May 03 15:57:15 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/SBSv2BuildConfigTabComposite.java Tue May 04 09:39:10 2010 -0500
@@ -52,6 +52,7 @@
}
public void createControls() {
+
setLayout(new GridLayout(2, false));
Label variantLabel = new Label(this, SWT.NONE);
@@ -89,8 +90,10 @@
public void initData(ICarbideBuildConfiguration buildConfig) {
this.config = buildConfig;
ISBSv2BuildConfigInfo sbsv2ConfigInfo = ((CarbideBuildConfiguration)buildConfig).getSBSv2ConfigInfo();
- if (sbsv2ConfigInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT) != null){
+ if (sbsv2ConfigInfo != null && sbsv2ConfigInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT) != null){
variantEdit.setText(sbsv2ConfigInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT));
+ } else {
+ variantEdit.setText("");
}
setVaraintDetailsText();
@@ -100,7 +103,11 @@
String configCmdText = configCmdLabelPrefixText;
if (config != null){
- configCmdText += config.getSBSv2Alias() + variantEdit.getText();
+ if (config.getSBSv2Alias() == null){
+ configCmdText += config.getPlatformString().toLowerCase() + "_" + config.getTargetString().toLowerCase() + variantEdit.getText();
+ } else {
+ configCmdText += config.getSBSv2Alias() + variantEdit.getText();
+ }
}
configCmdLabel.setText(configCmdText);
@@ -113,18 +120,17 @@
releaseTreeLabel.setText(relTreeText);
}
-
-
public boolean compareConfigurationSettings(ICarbideBuildConfiguration selectedConfig, boolean writeToConfig) {
boolean settingsEqual = true;
ISBSv2BuildConfigInfo currSBSv2Info = ((CarbideBuildConfiguration)selectedConfig).getSBSv2ConfigInfo();
- settingsEqual = currSBSv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT).equals(variantEdit.getText());
-
- if (!settingsEqual && writeToConfig) {
- currSBSv2Info.setSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT, variantEdit.getText());
- }
-
+ if (currSBSv2Info != null){
+ settingsEqual = currSBSv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT).equals(variantEdit.getText());
+
+ if (!settingsEqual && writeToConfig) {
+ currSBSv2Info.setSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT, variantEdit.getText());
+ }
+ }
return settingsEqual;
}