refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Wed Aug 04 12:55:23 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Wed Aug 04 16:39:47 2010 -0500
@@ -45,7 +45,6 @@
import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo;
-import com.nokia.carbide.cdt.internal.builder.ISBSv2BuildConfigInfo;
import com.nokia.carbide.cpp.epoc.engine.BldInfDataRunnableAdapter;
import com.nokia.carbide.cpp.epoc.engine.BldInfViewRunnableAdapter;
import com.nokia.carbide.cpp.epoc.engine.EpocEnginePlugin;
@@ -77,6 +76,7 @@
import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildContext;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo;
+import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildConfigInfo;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildContext;
import com.nokia.carbide.cpp.internal.api.sdk.SymbianBuildContextDataCache;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/PKGViewPathHelper.java Wed Aug 04 12:55:23 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/PKGViewPathHelper.java Wed Aug 04 16:39:47 2010 -0500
@@ -22,10 +22,7 @@
import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo;
-import com.nokia.carbide.cdt.internal.builder.CarbideBuildConfiguration;
-import com.nokia.carbide.cdt.internal.builder.ISBSv2BuildConfigInfo;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildContext;
-import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
import com.nokia.carbide.internal.api.cpp.epoc.engine.model.pkg.IPKGView;
import com.nokia.cpp.internal.api.utils.core.Check;
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/CarbideConfigurationDataProvider.java Wed Aug 04 12:55:23 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/CarbideConfigurationDataProvider.java Wed Aug 04 16:39:47 2010 -0500
@@ -53,7 +53,6 @@
import com.nokia.carbide.cdt.internal.builder.CarbideProjectInfo;
import com.nokia.carbide.cdt.internal.builder.EnvironmentVarsInfo;
import com.nokia.carbide.cdt.internal.builder.EnvironmentVarsInfo2;
-import com.nokia.carbide.cdt.internal.builder.ISBSv2BuildConfigInfo;
import com.nokia.carbide.cdt.internal.builder.SISBuilderInfo;
import com.nokia.carbide.cdt.internal.builder.gen.CarbideBuildConfig.CarbideBuilderConfigInfoType;
import com.nokia.carbide.cdt.internal.builder.gen.CarbideBuildConfig.ConfigurationType;
@@ -62,7 +61,9 @@
import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1;
import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv2;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildContext;
+import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildConfigInfo;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildContext;
+import com.nokia.carbide.cpp.internal.api.sdk.SBSv2BuilderInfo;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
@@ -184,32 +185,15 @@
if (rootStorage != null) {
for (ICStorageElement se : rootStorage.getChildren()) {
if (se.getName().equals(
- CarbideBuildConfiguration.SBSV2_DATA_ID)) {
+ ISBSv2BuildContext.SBSV2_DATA_ID)) {
- String value = se.getAttribute(ISBSv2BuildConfigInfo.ATRRIB_CONFIG_BASE_PLATFORM);
- if (value != null) {
- platform = value;
- }
-
- value = se.getAttribute(ISBSv2BuildConfigInfo.ATTRIB_CONFIG_TARGET);
- if (value != null) {
- target = value;
- }
-
- value = se.getAttribute(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_BUILD_ALIAS);
- if (value != null) {
- buidAlias = value;
- }
-
- value = se.getAttribute(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_CONFIG_DISPLAY_STRING);
- if (value != null) {
- displayString = value;
- }
-
- value = se.getAttribute(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_SDK_ID);
- if (value != null) {
- sdkID = value;
- }
+ SBSv2BuilderInfo sbsv2BuilderInfo = new SBSv2BuilderInfo();
+ sbsv2BuilderInfo.loadFromStorage(se);
+ platform = sbsv2BuilderInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATRRIB_CONFIG_BASE_PLATFORM);
+ target = sbsv2BuilderInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_CONFIG_TARGET);
+ buidAlias = sbsv2BuilderInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_BUILD_ALIAS);
+ displayString = sbsv2BuilderInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_CONFIG_DISPLAY_STRING);
+ sdkID = sbsv2BuilderInfo.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_SDK_ID);
}
}
} else {
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Wed Aug 04 12:55:23 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Wed Aug 04 16:39:47 2010 -0500
@@ -66,9 +66,6 @@
protected final static String ENV_VAR_DATA_ID = "ENV_VAR_DATA_ID"; //$NON-NLS-1$
protected final static String ROM_BUILDER_DATA_ID = "ROM_BUILDER_DATA_ID"; //$NON-NLS-1$
- // SBSv2 only config settings
- public final static String SBSV2_DATA_ID = "SBSV2_DATA_ID"; //$NON-NLS-1$
-
protected ISymbianBuildContext context;
protected TrackedResource projectTracker;
protected List<ISISBuilderInfo> sisBuilderInfoList;
@@ -128,7 +125,7 @@
envVarsInfo.saveToStorage(rootStorage.createChild(ENV_VAR_DATA_ID));
// Save build context specific settings.
- this.getBuildContext().saveConfigurationSettings(rootStorage);
+ this.getBuildContext().saveConfigurationSettings(rootStorage, getBuildContext());
}
}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ISBSv2BuildConfigInfo.java Wed Aug 04 12:55:23 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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;
-
-/**
- * Interface to SBSv2 build configuration specific data
- */
-public interface ISBSv2BuildConfigInfo {
-
- // Data attribute id's saved in .cproject file
- public final static String ATRRIB_CONFIG_BASE_PLATFORM = "CONFIG_BASE_PLATFORM"; //$NON-NLS-1$
- 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_SDK_ID = "ATTRIB_SBSV2_SDK_ID";
-
- /** Retrieve a specfic .cproject SBSv2 data value from a given ID */
- String getSBSv2Setting(String id);
-
- /**
- * Set a specific SBSv2 configuration specific data value
- * @param id
- * @param value
- */
- void setSBSv2Setting(String id, String value);
-}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java Wed Aug 04 12:55:23 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java Wed Aug 04 16:39:47 2010 -0500
@@ -549,7 +549,7 @@
}
@Override
- public void saveConfigurationSettings(ICStorageElement se) {
+ public void saveConfigurationSettings(ICStorageElement se, ISymbianBuildContext context) {
saveBuildArgsToStorage(se.createChild(ARGUMENTS_DATA_ID));
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Wed Aug 04 12:55:23 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Wed Aug 04 16:39:47 2010 -0500
@@ -18,6 +18,7 @@
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2ConfigQueryData;
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2MinimumVersionException;
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2QueryUtils;
+import com.nokia.carbide.cpp.internal.sdk.core.model.SBSv2BuildInfo;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
@@ -37,6 +38,9 @@
// Raptor config query data
private ISBSv2ConfigQueryData configQueryData;
+ // cconfiguration data store
+ private SBSv2BuilderInfo sbsv2BuildInfo;
+
public BuildContextSBSv2(ISymbianSDK sdk, String platform, String target, String alias, String displayString, String configID) {
this.sdk = sdk;
if (platform == null){
@@ -375,14 +379,17 @@
@Override
public void loadConfigurationSettings(ICStorageElement se) {
- // TODO Auto-generated method stub
+ if (sbsv2BuildInfo == null){
+ sbsv2BuildInfo = new SBSv2BuilderInfo();
+ }
+ sbsv2BuildInfo.loadFromStorage(se);
}
@Override
- public void saveConfigurationSettings(ICStorageElement se) {
- // TODO Auto-generated method stub
-
+ public void saveConfigurationSettings(ICStorageElement se, ISymbianBuildContext context) {
+ sbsv2BuildInfo = new SBSv2BuilderInfo((ISBSv2BuildContext)context);
+ sbsv2BuildInfo.saveToStorage(se.createChild(SBSV2_DATA_ID));
}
-
+
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv2BuildConfigInfo.java Wed Aug 04 16:39:47 2010 -0500
@@ -0,0 +1,40 @@
+/*
+* 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.cpp.internal.api.sdk;
+
+/**
+ * Interface to SBSv2 build configuration specific data
+ */
+public interface ISBSv2BuildConfigInfo {
+
+ // Data attribute id's saved in .cproject file
+ public final static String ATRRIB_CONFIG_BASE_PLATFORM = "CONFIG_BASE_PLATFORM"; //$NON-NLS-1$
+ 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_SDK_ID = "ATTRIB_SBSV2_SDK_ID";
+
+ /** Retrieve a specfic .cproject SBSv2 data value from a given ID */
+ String getSBSv2Setting(String id);
+
+ /**
+ * Set a specific SBSv2 configuration specific data value
+ * @param id
+ * @param value
+ */
+ void setSBSv2Setting(String id, String value);
+}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv2BuildContext.java Wed Aug 04 12:55:23 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv2BuildContext.java Wed Aug 04 16:39:47 2010 -0500
@@ -25,6 +25,9 @@
public static final String MACRO_GCCE = "__GCCE__";
public static final String MACRO_WINSCW = "__WINSCW__";
+ // SBSv2 only config settings
+ public final static String SBSV2_DATA_ID = "SBSV2_DATA_ID"; //$NON-NLS-1$
+
/**
* Retrieve the build-able configuration; a valid command that cab be passed with Raptor's -c parameter.
* This should not be used and should return null for abld-configurations.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2BuilderInfo.java Wed Aug 04 16:39:47 2010 -0500
@@ -0,0 +1,121 @@
+/*
+* 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.cpp.internal.api.sdk;
+
+import java.util.HashMap;
+
+import org.eclipse.cdt.core.settings.model.ICStorageElement;
+
+import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildContext;
+import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
+
+public class SBSv2BuilderInfo implements ISBSv2BuildConfigInfo {
+
+ HashMap<String, String> sbsv2ConfigDataMap = new HashMap<String, String>();
+
+ ISymbianBuildContext context;
+
+ public SBSv2BuilderInfo(ISBSv2BuildContext context) {
+ String buildAlias = context.getSBSv2Alias() != null ? context.getSBSv2Alias() : "";
+ sbsv2ConfigDataMap.put(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_BUILD_ALIAS, buildAlias);
+ 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_SDK_ID, context.getSDK().getUniqueId());
+ this.context = context;
+ }
+
+ /**
+ * Using the default constructor presumes the sbsv2ConfigDataMap will be filled out by subsequent calls to loadFromStorage(ICStorageElement rootStorage)
+ * or setSBSv2Setting(String id, String value)
+ */
+ public SBSv2BuilderInfo(){
+
+ }
+
+ public void loadFromStorage(ICStorageElement rootStorage) {
+
+ String value = rootStorage.getAttribute(ATRRIB_CONFIG_BASE_PLATFORM);
+ if (value != null) {
+ sbsv2ConfigDataMap.put(ATRRIB_CONFIG_BASE_PLATFORM, value);
+ }
+
+ value = rootStorage.getAttribute(ATTRIB_CONFIG_TARGET);
+ if (value != null) {
+ sbsv2ConfigDataMap.put(ATTRIB_CONFIG_TARGET, value);
+ }
+
+ value = rootStorage.getAttribute(ATTRIB_SBSV2_BUILD_ALIAS);
+ if (value != null) {
+ sbsv2ConfigDataMap.put(ATTRIB_SBSV2_BUILD_ALIAS, value);
+ }
+
+ value = rootStorage.getAttribute(ATTRIB_SBSV2_CONFIG_DISPLAY_STRING);
+ if (value != null) {
+ sbsv2ConfigDataMap.put(ATTRIB_SBSV2_CONFIG_DISPLAY_STRING, value);
+ }
+
+ value = rootStorage.getAttribute(ATTRIB_SBSV2_SDK_ID);
+ if (value != null) {
+ sbsv2ConfigDataMap.put(ATTRIB_SBSV2_SDK_ID, value);
+ }
+ }
+
+ public void saveToStorage(ICStorageElement rootStorage) {
+
+ String value = sbsv2ConfigDataMap.get(ATRRIB_CONFIG_BASE_PLATFORM);
+ if (value != null && value.trim().length() > 0){
+ rootStorage.setAttribute(ATRRIB_CONFIG_BASE_PLATFORM, value);
+ }
+
+ value = sbsv2ConfigDataMap.get(ATTRIB_CONFIG_TARGET);
+ if (value != null && value.trim().length() > 0){
+ rootStorage.setAttribute(ATTRIB_CONFIG_TARGET, value);
+ }
+
+ value = sbsv2ConfigDataMap.get(ATTRIB_SBSV2_BUILD_ALIAS);
+ if (value != null && value.trim().length() > 0){
+ rootStorage.setAttribute(ATTRIB_SBSV2_BUILD_ALIAS, value);
+ }
+
+ value = sbsv2ConfigDataMap.get(ATTRIB_SBSV2_CONFIG_DISPLAY_STRING);
+ if (value != null && value.trim().length() > 0){
+ rootStorage.setAttribute(ATTRIB_SBSV2_CONFIG_DISPLAY_STRING, value);
+ }
+
+ value = sbsv2ConfigDataMap.get(ATTRIB_SBSV2_SDK_ID);
+ if (value != null && value.trim().length() > 0){
+ rootStorage.setAttribute(ATTRIB_SBSV2_SDK_ID, value);
+ }
+
+ }
+
+ /**
+ * @see {@link ISBSv2BuildConfigInfo} for id values
+ */
+ public String getSBSv2Setting(String id) {
+ return sbsv2ConfigDataMap.get(id);
+ }
+
+ /**
+ * @see {@link ISBSv2BuildConfigInfo} for id values
+ */
+ public void setSBSv2Setting(String id, String value) {
+ sbsv2ConfigDataMap.put(id, value);
+ }
+
+}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuildContext.java Wed Aug 04 12:55:23 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuildContext.java Wed Aug 04 16:39:47 2010 -0500
@@ -132,9 +132,10 @@
/**
* Save build context specific configuration settings
+ * @param ISymbianBuildContext
* @param ICStorageElement - a child of CARBIDE_STORAGE_ID ("CarbideConfigurationDataProvider") in .cproject data
* @since 3.0
*/
- public void saveConfigurationSettings(ICStorageElement se);
+ public void saveConfigurationSettings(ICStorageElement se, ISymbianBuildContext ISymbianBuildContext);
}