more fixes from bug 11210 to support saving SBSv2 tab data for old-style SBSv2 config names (i.e. before build alias)
authortimkelly
Tue, 04 May 2010 09:59:19 -0500
changeset 1326 4e42250a2a51
parent 1324 bb9280b14e6a
child 1327 f0fa49ad9b81
more fixes from bug 11210 to support saving SBSv2 tab data for old-style SBSv2 config names (i.e. before build alias)
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv2Builder.java
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/SBSv2BuilderInfo.java
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/SBSv2BuildConfigTabComposite.java
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java	Mon May 03 16:39:42 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java	Tue May 04 09:59:19 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 16:39:42 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv2Builder.java	Tue May 04 09:59:19 2010 -0500
@@ -89,6 +89,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);
@@ -505,12 +509,7 @@
 		args.add(cpi.getAbsoluteBldInfPath().toOSString());
 		args.add("-c"); //$NON-NLS-1$
 		String configName = getConfigName(buildConfig);
-		if (configName == null){
-			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$
 		}
@@ -590,12 +589,6 @@
 		IPath workingDirectory = cpi.getINFWorkingDirectory();
 		
 		String configName = getConfigName(buildConfig);
-		if (configName == null){
-			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 16:39:42 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/SBSv2BuilderInfo.java	Tue May 04 09:59:19 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 16:39:42 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/SBSv2BuildConfigTabComposite.java	Tue May 04 09:59:19 2010 -0500
@@ -91,6 +91,8 @@
 		ISBSv2BuildConfigInfo sbsv2ConfigInfo = ((CarbideBuildConfiguration)buildConfig).getSBSv2ConfigInfo();
 		if (sbsv2ConfigInfo != null && sbsv2ConfigInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT) != null){
 			variantEdit.setText(sbsv2ConfigInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT));
+		} else {
+			variantEdit.setText("");
 		}
 		
 		setVaraintDetailsText();