Remove SBSv2 configuration tab and associated data store. Variants are handled in the configuration creation now and not as a preference after-thought. C3_BUILDER_WORK
authortimkelly
Tue, 27 Jul 2010 15:12:04 -0500
branchC3_BUILDER_WORK
changeset 1701 e82be937be91
parent 1700 aa833f2c99b6
child 1706 3ecac009d20b
Remove SBSv2 configuration tab and associated data store. Variants are handled in the configuration creation now and not as a preference after-thought.
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/PKGViewPathHelper.java
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/CarbideConfigurationDataProvider.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/ISBSv2BuildConfigInfo.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/CarbideBuildConfigurationsPage.java
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/SBSv2BuildConfigTabComposite.java
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/PKGViewPathHelper.java	Tue Jul 27 15:03:22 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/PKGViewPathHelper.java	Tue Jul 27 15:12:04 2010 -0500
@@ -25,6 +25,7 @@
 import com.nokia.carbide.cdt.internal.builder.CarbideBuildConfiguration;
 import com.nokia.carbide.cdt.internal.builder.ISBSv2BuildConfigInfo;
 import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
+import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext;
 import com.nokia.carbide.internal.api.cpp.epoc.engine.model.pkg.IPKGView;
 import com.nokia.cpp.internal.api.utils.core.Check;
 
@@ -75,10 +76,7 @@
 		this.platform = buildConfig.getPlatformString();		
 		if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(buildConfig.getCarbideProject().getProject())){
 			// Test is this is an SBSv2 build binary variant (changes the output directory)
-			ISBSv2BuildConfigInfo sbsv2Info = ((CarbideBuildConfiguration)buildConfig).getSBSv2BuildConfigInfo();
-			if ( sbsv2Info != null && SBSv2Utils.getVariantOutputDirModifier(sbsv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT)) != null && !platform.contains(".") ){
-				this.platform = this.platform + SBSv2Utils.getVariantOutputDirModifier(sbsv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT));
-			}
+			this.platform = ((ISBSv2BuildContext)buildConfig.getBuildContext()).getPlatformReleaseDirName();
 		} 
 		this.target = buildConfig.getTargetString();
 		this.mainDirectory = pkgFilePath.removeLastSegments(1);
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java	Tue Jul 27 15:03:22 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java	Tue Jul 27 15:12:04 2010 -0500
@@ -80,6 +80,7 @@
 import com.nokia.carbide.cpp.internal.qt.core.QtCorePlugin;
 import com.nokia.carbide.cpp.internal.x86build.X86BuildPlugin;
 import com.nokia.carbide.cpp.sdk.core.ISBSv1BuildContext;
+import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext;
 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
 import com.nokia.carbide.internal.api.cpp.epoc.engine.model.pkg.EPKGLanguage;
@@ -1943,12 +1944,9 @@
     				// need to create a new PKG file, resolved...
     				pkgFileStr = pkgFileStr.replace(PKG_SYMBOL_EPOCROOT, context.getSDK().getEPOCROOT());
     				String platSubst = context.getPlatformString().toLowerCase();				
-    				if (context instanceof CarbideBuildConfiguration){
+    				if (context instanceof ISBSv2BuildContext){
     					// Test is this is an SBSv2 build binary variant (changes the output directory)
-    					ISBSv2BuildConfigInfo sbsv2Info = ((CarbideBuildConfiguration)context).getSBSv2BuildConfigInfo();
-    					if (sbsv2Info != null && SBSv2Utils.getVariantOutputDirModifier(sbsv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT)) != null){
-    						platSubst = platSubst + SBSv2Utils.getVariantOutputDirModifier(sbsv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT));
-    					}
+    					platSubst = ((ISBSv2BuildContext)context).getPlatformReleaseDirName();
     				}
     				pkgFileStr = pkgFileStr.replace(PKG_SYMBOL_PLATFORM, platSubst);
     				pkgFileStr = pkgFileStr.replace(PKG_SYMBOL_TARGET, context.getTargetString().toLowerCase());
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/CarbideConfigurationDataProvider.java	Tue Jul 27 15:03:22 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/CarbideConfigurationDataProvider.java	Tue Jul 27 15:12:04 2010 -0500
@@ -177,7 +177,6 @@
 		String platform = null;
 		String target = null;
 		String displayString = null;
-		String variant = "";
 		String sdkID = null;
 		if (rootStorage != null) {
 			for (ICStorageElement se : rootStorage.getChildren()) {
@@ -189,11 +188,6 @@
 						platform = value;
 					}
 
-					value = se.getAttribute(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT);
-					if (value != null) {
-						variant = value;
-					}
-
 					value = se.getAttribute(ISBSv2BuildConfigInfo.ATTRIB_CONFIG_TARGET);
 					if (value != null) {
 						target = value;
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv2Builder.java	Tue Jul 27 15:03:22 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv2Builder.java	Tue Jul 27 15:12:04 2010 -0500
@@ -103,14 +103,6 @@
     		buildAlias = buildAlias.split("\\.")[0];
     	}
     	
-    	ISBSv2BuildConfigInfo sbsv2Info = ((CarbideBuildConfiguration)buildConfig).getSBSv2BuildConfigInfo();
-    	if (sbsv2Info != null){
-    		String variant = sbsv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT);
-    		if (variant != null && variant.length() > 1){
-    			buildAlias = buildAlias + variant;
-    		}
-    		
-    	}
     	return buildAlias;
     }
     
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ISBSv2BuildConfigInfo.java	Tue Jul 27 15:03:22 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ISBSv2BuildConfigInfo.java	Tue Jul 27 15:12:04 2010 -0500
@@ -26,7 +26,6 @@
 	public final static String ATTRIB_CONFIG_TARGET = "CONFIG_TARGET"; //$NON-NLS-1$ 
 	public final static String ATTRIB_SBSV2_BUILD_ALIAS = "SBSV2_BUILD_ALIAS"; //$NON-NLS-1$ 
 	public final static String ATTRIB_SBSV2_CONFIG_DISPLAY_STRING = "SBSV2_CONFIG_DISPLAY_STRING"; //$NON-NLS-1$ 
-	public final static String ATTRIB_SBSV2_VARIANT = "ATTRIB_SBSV2_VARIANT";
 	public final static String ATTRIB_SBSV2_SDK_ID = "ATTRIB_SBSV2_SDK_ID";
 	
 	/** Retrieve a specfic .cproject SBSv2 data value from a given ID */
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/SBSv2BuilderInfo.java	Tue Jul 27 15:03:22 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/SBSv2BuilderInfo.java	Tue Jul 27 15:12:04 2010 -0500
@@ -38,7 +38,6 @@
 		sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATRRIB_CONFIG_BASE_PLATFORM, context.getPlatformString());
 		sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATTRIB_CONFIG_TARGET, context.getTargetString());
 		sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_CONFIG_DISPLAY_STRING, context.getDisplayString());
-		sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT, "");
 		sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_SDK_ID, context.getSDK().getUniqueId());
 		this.context = context;
 	}
@@ -50,11 +49,6 @@
 			sbsv2ConfigDataMap.put(ATRRIB_CONFIG_BASE_PLATFORM, value);
 		}
 		
-		value = rootStorage.getAttribute(ATTRIB_SBSV2_VARIANT);
-		if (value != null) {
-			sbsv2ConfigDataMap.put(ATTRIB_SBSV2_VARIANT, value);
-		}
-		
 		value = rootStorage.getAttribute(ATTRIB_CONFIG_TARGET);
 		if (value != null) {
 			sbsv2ConfigDataMap.put(ATTRIB_CONFIG_TARGET, value);
@@ -74,8 +68,6 @@
 		if (value != null) {
 			sbsv2ConfigDataMap.put(ATTRIB_SBSV2_SDK_ID, value);
 		}
-		
-		
 	}
 	
 	public void saveToStorage(ICStorageElement rootStorage) {
@@ -85,11 +77,6 @@
 			rootStorage.setAttribute(ATRRIB_CONFIG_BASE_PLATFORM, value);
 		}
 		
-		value = sbsv2ConfigDataMap.get(ATTRIB_SBSV2_VARIANT);
-		if (value != null && value.trim().length() > 0){
-			rootStorage.setAttribute(ATTRIB_SBSV2_VARIANT, value);
-		}
-		
 		value = sbsv2ConfigDataMap.get(ATTRIB_CONFIG_TARGET);
 		if (value != null && value.trim().length() > 0){
 			rootStorage.setAttribute(ATTRIB_CONFIG_TARGET, value);
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/CarbideBuildConfigurationsPage.java	Tue Jul 27 15:03:22 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/CarbideBuildConfigurationsPage.java	Tue Jul 27 15:12:04 2010 -0500
@@ -153,10 +153,7 @@
 
 	// rom builder tab
 	ROMBuilderTabComposite romBuilderTabComposite;
-	
-	// SBSv2 config data tab
-	SBSv2BuildConfigTabComposite sbsv2BuildConfigTabComposite;
-	
+		
 	// Configuration management/switching
 	private IProject project;
 	private BuildConfigCombo buildConfigurationCombo;
@@ -226,20 +223,6 @@
 		data.horizontalIndent = 18;
 		data.verticalIndent = 18;
 		control.setLayoutData(data);
-
-		//////////////////// SBSv2 Config Data Tab /////////////
-		if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(project)) {
-			
-			TabItem sbsV2TabItem = new TabItem(tabFolder, SWT.NONE);
-			sbsV2TabItem.setText(Messages.getString("CarbideBuildConfigurationsPage.SBSv2_Tab")); //$NON-NLS-1$
-			sbsV2TabItem.setToolTipText(Messages.getString("CarbideBuildConfigurationsPage.Environement_Tab_ToolTip")); //$NON-NLS-1$
-			
-			sbsv2BuildConfigTabComposite = new SBSv2BuildConfigTabComposite(sbsV2TabItem);
-			sbsv2BuildConfigTabComposite.createControls();
-			sbsV2TabItem.setControl(sbsv2BuildConfigTabComposite);
-		}
-		////////////////////////////////////////////////////////
-		
 		
 		////////////////////// Environment Tab ////////////////
 		TabItem envTabItem = new TabItem(tabFolder, SWT.NONE);
@@ -381,9 +364,7 @@
 				ICarbideBuildConfiguration config = cpi.getDefaultConfiguration();
 				if (config != null) {
 					sisFilesBlock.initData(config);
-					if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(project)) {
-						sbsv2BuildConfigTabComposite.initData(config);
-					}
+					
 					if (argumentsTabcomposite != null) {
 						argumentsTabcomposite.initData(config);
 					}
@@ -660,9 +641,7 @@
 		boolean sisSettingsEqual = sisFilesBlock.compareConfigurationSettings(selectedConfig, writeToConfig);
 		
 		boolean sbsv2ConfigEqual = true;
-		if (sbsv2BuildConfigTabComposite != null) { 
-			sbsv2ConfigEqual = sbsv2BuildConfigTabComposite.compareConfigurationSettings(selectedConfig, writeToConfig);
-		}
+		
 		// Compare envVars settings
 		boolean envVarsSettingsEqual = envVarList.size() == envVarListOrig.size() && envVarList.equals(envVarListOrig);
 		if (!envVarsSettingsEqual && writeToConfig) {
@@ -981,9 +960,7 @@
 		ICarbideBuildConfiguration lastConfig = cpi.getNamedConfiguration(lastSelectedConfigName);
 		if (lastConfig != null) {
 			sisFilesBlock.initData(lastConfig);
-			if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(project)) {
-				sbsv2BuildConfigTabComposite.initData(lastConfig);
-			}
+			
 			setUpEnvVarsTable(new String[0], null); // refresh env vars info
 			if (argumentsTabcomposite != null) {
 				argumentsTabcomposite.initData(lastConfig);
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/SBSv2BuildConfigTabComposite.java	Tue Jul 27 15:03:22 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-package com.nokia.carbide.cdt.internal.builder.ui;
-
-import java.io.File;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Text;
-
-import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
-import com.nokia.carbide.cdt.internal.builder.CarbideBuildConfiguration;
-import com.nokia.carbide.cdt.internal.builder.ISBSv2BuildConfigInfo;
-import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
-import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext;
-import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
-
-public class SBSv2BuildConfigTabComposite extends Composite {
-	
-	private static final String configCmdLabelPrefixText = "Configuration Command: -c "; // $NON-NLS-N$ 
-	private static final String releaseTreeLabelPrefixText = "Release Tree: "; // $NON-NLS-N$
-	
-	Text variantEdit;
-	
-	Label configCmdLabel;
-	Label releaseTreeLabel;
-	private ICarbideBuildConfiguration config;
-	ISBSv2BuildContext context;
-	
-	public SBSv2BuildConfigTabComposite(TabItem tabItem) {
-		super(tabItem.getParent(), SWT.NONE);
-	}
-
-	public void createControls() {
-		setLayout(new GridLayout(2, false));
-
-		Label variantLabel = new Label(this, SWT.NONE);
-		variantLabel.setText(Messages.getString("CarbideSBSv2ConfigTab.VariantLabel")); //$NON-NLS-1$
-		variantLabel.setToolTipText(Messages.getString("CarbideSBSv2ConfigTab.VariantLabel_ToolTip")); //$NON-NLS-1$
-
-		variantEdit = new Text(this, SWT.BORDER);
-		variantEdit.setToolTipText(Messages.getString("CarbideSBSv2ConfigTab.VariantLabel_ToolTip")); //$NON-NLS-1$
-		variantEdit.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-		SelectionListener listener;
-		variantEdit.addKeyListener( new KeyListener() {
-			
-			public void keyReleased(KeyEvent e) {
-				setVaraintDetailsText();
-			}
-			
-			public void keyPressed(KeyEvent e) {
-				// ignore
-			}
-		});
-		
-		Group emulatorBuildOptionsGroup;
-		emulatorBuildOptionsGroup = new Group(this, SWT.NONE);
-		emulatorBuildOptionsGroup.setLayout(new GridLayout(1, false));
-		GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
-		emulatorBuildOptionsGroup.setLayoutData(gd);
-		emulatorBuildOptionsGroup.setText("Build Variant Details"); //$NON-NLS-1$
-
-		configCmdLabel = new Label(emulatorBuildOptionsGroup, SWT.CHECK);
-		configCmdLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-		releaseTreeLabel = new Label(emulatorBuildOptionsGroup, SWT.CHECK);
-		releaseTreeLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-	}
-	
-	public void initData(ICarbideBuildConfiguration buildConfig) {
-		this.config = buildConfig;
-		context = (ISBSv2BuildContext)buildConfig.getBuildContext();
-		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();
-	}
-	
-	private void setVaraintDetailsText() {
-		
-		String configCmdText = configCmdLabelPrefixText;
-		if (context != null){
-			if (context.getSBSv2Alias() == null){
-				configCmdText += config.getPlatformString().toLowerCase() + "_" + config.getTargetString().toLowerCase() + variantEdit.getText();
-			} else {
-				configCmdText += context.getSBSv2Alias() + variantEdit.getText();
-			}
-		}
-		configCmdLabel.setText(configCmdText);
-
-		String variantText = SBSv2Utils.getVariantOutputDirModifier(variantEdit.getText());
-		if (variantText == null) variantText = "";	
-		String relTreeText = releaseTreeLabelPrefixText;
-		if (config != null){
-			relTreeText += " " + config.getSDK().getEPOCROOT() + "epoc32" + File.separator + "release" + File.separator + config.getPlatformString().toLowerCase() + variantText + File.separator + config.getTargetString().toLowerCase();
-		}
-		releaseTreeLabel.setText(relTreeText);
-	}
-
-	
-
-	public boolean compareConfigurationSettings(ICarbideBuildConfiguration selectedConfig, boolean writeToConfig) {
-		boolean settingsEqual = true;
-		
-		ISBSv2BuildConfigInfo currSBSv2Info = ((CarbideBuildConfiguration)selectedConfig).getSBSv2ConfigInfo();
-		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;
-	}
-	
-	public void performDefaults(ISymbianSDK sdk) {
-		variantEdit.setText("");
-	}
-}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java	Tue Jul 27 15:03:22 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java	Tue Jul 27 15:12:04 2010 -0500
@@ -54,4 +54,11 @@
 	 * @return list of include paths
 	 */
 	public List<IPath> getSystemIncludes();
+	
+	/**
+	 * Retrieve the actual \epoc32\release directory a binary is targeted for. 
+	 * @return
+	 */
+	public String getPlatformReleaseDirName();
+	
 }