fix npe, clear sbsv2 query cache data in memory when rebuilding sbsv2 cache from pref, other code clean-up
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Thu Aug 12 10:37:00 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Thu Aug 12 15:56:37 2010 -0500
@@ -279,8 +279,11 @@
}
// add OEM dir
- File oemDir = sdk.getIncludePath().append("oem").toFile();
- if (oemDir.exists()) {
+ File oemDir = null;
+ if (sdk.getIncludePath() != null){
+ oemDir = sdk.getIncludePath().append("oem").toFile();
+ }
+ if (oemDir != null && oemDir.exists()) {
includeEntries.add(new CIncludePathEntry(new Path(oemDir.getAbsolutePath()), 0));
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java Thu Aug 12 10:37:00 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java Thu Aug 12 15:56:37 2010 -0500
@@ -179,13 +179,12 @@
@SuppressWarnings("unused")
public static boolean enableSBSv1Support() {
+ // hard-coded shut off
if (!SDKCorePlugin.SUPPORTS_SBSV1_BUILDER)
return false;
- else if (!enableSBSv2Support())
- return true;
-
- else if (isSBSv1Supported())
+ // check perl script
+ else if (isSBSv1Supported())
return true;
return false;
@@ -250,33 +249,6 @@
return contexts;
}
- /**
- * If a variant is defined and it changes the output directory, return the directory name.
- * For example, armv5_udeb.phone1 would return '.phone1'. If not variant that changes the release tree, then null
- * NOTE: This method deals with variant text applied to the end of a build alias, specifically testing for
- * variant text defined in the SBSv2 Build Configuration tab.
- * @return null if not a variant or the value to append to the platform release tree directory
- * @see com.nokia.carbide.cdt.internal.builder.ui#SBSv2BuildConfigTab
- */
- public static String getVariantOutputDirModifier(String variantText) {
-
- String[] ignoredVariants = { "generic", "tracecompiler", "trace", "test", "savespace",
- "bfc", "smp", "rvct2_2", "rvct4_0", "rvct3_1", "gcce4_3_2", "remove_freeze" };
-
- String newOutputDir = null;
- if (variantText != null && variantText.length() > 1){
- String[] variantTok = variantText.split("\\.");
- if (variantTok.length > 1){
- for (String ignore : ignoredVariants){
- if (variantTok[1].toLowerCase().equals(ignore))
- return null;
- }
- newOutputDir = "." + variantTok[1];
- }
- }
- return newOutputDir;
- }
-
private static boolean isSBSv1Supported() {
ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
for (ISymbianSDK sdk : sdkMgr.getSDKList()) {
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Thu Aug 12 10:37:00 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Thu Aug 12 15:56:37 2010 -0500
@@ -188,7 +188,11 @@
List<IDefine> macros = new ArrayList<IDefine>();
Map<String, IDefine> namedMacros = new HashMap<String, IDefine>();
- File prefixFile = context.getPrefixFromVariantCfg().toFile();
+ File prefixFile = null;
+ if (context.getPrefixFromVariantCfg() != null){
+ prefixFile = context.getPrefixFromVariantCfg().toFile();
+ }
+
ISDKBuildInfo buildInfo = sdk.getBuildInfo(builderId);
if (prefixFile == null){
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Thu Aug 12 10:37:00 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Thu Aug 12 15:56:37 2010 -0500
@@ -28,7 +28,6 @@
import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv2;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildContext;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo;
-import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2ConfigQueryData;
import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2ConfigQueryData;
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2MinimumVersionException;
@@ -40,7 +39,8 @@
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
/**
- * SBSv2 specific build information.
+ * SBSv2 specific build information. Serves as a container for build data container for a Symbian SDK using SBSv2
+ * @since 3.0
*
*/
public class SBSv2BuildInfo implements ISBSv2BuildInfo {
@@ -68,6 +68,15 @@
return sbsv2FilteredConetxts;
}
+ public void clearDataFromBuildCache(){
+ aliasToMeaningMap.clear();
+ if (productList != null) productList.clear();
+ sbsv2FilteredConetxts.clear();
+ cachedBuildMacros.clear();
+ cachedMetadataMacros.clear();
+ cachedVariantHRHFile = null;
+ }
+
@Override
public List<ISymbianBuildContext> getFilteredBuildConfigurations() {
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java Thu Aug 12 10:37:00 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java Thu Aug 12 15:56:37 2010 -0500
@@ -34,7 +34,7 @@
* Value given for an SDK that is created when a build configuration
* references an non-existent SDK.
*/
- public static String BAD_EPOCROOT = "BAD_SDK_ROOT";
+ public static String BAD_EPOCROOT = "/BAD_SDK_ROOT";
/**
* Returns build info for a particular builder.
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Thu Aug 12 10:37:00 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Thu Aug 12 15:56:37 2010 -0500
@@ -44,9 +44,12 @@
import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
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.internal.sdk.core.model.SDKManager;
import com.nokia.carbide.cpp.internal.sdk.ui.AddSBSv2ProductVariant;
import com.nokia.carbide.cpp.internal.sdk.ui.Messages;
+import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
/**
@@ -121,6 +124,11 @@
SBSv2QueryUtils.removeAllCachedQueries();
clearLocalSBSCacheData();
initTable();
+
+ for (ISymbianSDK sdk : SDKCorePlugin.getSDKManager().getSDKList()){
+ ((SBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER)).clearDataFromBuildCache();
+ }
+
refreshButton.setText(Messages.getString("SBSv2PlatformFilterComposite.RefreshButtonText")); //$NON-NLS-1$
refreshButton.setEnabled(true);
}
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Thu Aug 12 10:37:00 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Thu Aug 12 15:56:37 2010 -0500
@@ -39,7 +39,7 @@
@SuppressWarnings("restriction")
public class BuildTargetTreeNode extends TreeNode {
- public static final String SDK_NODE_ERROR_EPOCROOT_INVALID = " -- SDK location does not exist! Check Symbian SDKs!"; //$NON-NLS
+ public static final String SDK_NODE_ERROR_EPOCROOT_INVALID = " SDK location does not exist! Check Symbian SDKs!"; //$NON-NLS
/**
* Constructs a new tree node for the given SDK
@@ -94,7 +94,7 @@
ISymbianSDK value = (ISymbianSDK) getValue();
File f = new File(value.getEPOCROOT());
if (!f.exists()){
- return value.getUniqueId() + SDK_NODE_ERROR_EPOCROOT_INVALID;
+ return value.getUniqueId() + " (" + f.getAbsolutePath() + ") " + SDK_NODE_ERROR_EPOCROOT_INVALID;
}
return value.getUniqueId();
}