# HG changeset patch # User timkelly # Date 1276801247 18000 # Node ID 268b8ede3928bf4a4750817780e06e9f8b0505c0 # Parent f1eec65aaede28c3f5bae64df5631b10db817a0e Update the SBSv2 filtering pref options from the Raptor alias query (union of all available build configs from Raptor). Update the display message for a broken config only in the tree viewer and not in the display name itself (in case user create a config any ways) diff -r f1eec65aaede -r 268b8ede3928 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Thu Jun 17 11:41:12 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Thu Jun 17 14:00:47 2010 -0500 @@ -63,12 +63,7 @@ this.meaning = meaning; this.configID = ISBSv2BuildContext.BUILDER_ID + "." + sbsv2Alias + "." + sdk.getUniqueId(); parseQueryConfigResults(contextQueryXML); - - if (configParseErrorMessage != null && configParseErrorMessage.length() > 0){ - this.displayString = sbsv2Alias + " ERROR: " + configParseErrorMessage; - } else { - this.displayString = sbsv2Alias + " [" + sdk.getUniqueId() + "]"; - } + this.displayString = sbsv2Alias + " [" + sdk.getUniqueId() + "]"; } @Override @@ -84,7 +79,8 @@ } if (platform.contains(".")){ - return platform.split(".")[0]; + String[] tok = platform.split("."); + if (tok.length > 0) return tok[0]; } return platform; } @@ -459,6 +455,7 @@ * Error message, if any. * @return An error message if a problem occurred while trying to get config info from Raptor. Null if no error. */ + @Override public String getConfigurationErrorMessage(){ return configParseErrorMessage; } diff -r f1eec65aaede -r 268b8ede3928 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java Thu Jun 17 11:41:12 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java Thu Jun 17 14:00:47 2010 -0500 @@ -352,10 +352,29 @@ if (sbsVers.compareTo(SDKCorePlugin.getSDKManager().getMinimumSupportedSBSv2Version()) >= 0) return true; else { - String message = "Raptor/SBSv2 minimum version supported in Carbide.c++ is " + SDKCorePlugin.getSDKManager().getMinimumSupportedSBSv2Version() + ". Your sbs version is " + sbsVers + ". Please update your sbs installation."; + String message = "Raptor/SBSv2 minimum version supported in Carbide.c++ is " + SDKCorePlugin.getSDKManager().getMinimumSupportedSBSv2Version() + ". Your sbs version is " + sbsVers + ". Please update your sbs installation and Rescan from the Build Configuration Manager preference page ."; throw new SBSv2MinimumVersionException(message); } } + + public static HashMap getCompleteAliasList() throws SBSv2MinimumVersionException { + HashMap resultMap = new HashMap(); + //return getAliasesForSDK(null); + + // iterate all SDKs and build the map up + for (ISymbianSDK sdk : SDKCorePlugin.getSDKManager().getSDKList()){ + if (sdk.isEnabled() && (new File(sdk.getEPOCROOT()).exists())){ + HashMap aliasMap = getAliasesForSDK(sdk); + for (String alias : aliasMap.keySet()){ + if (resultMap.get(alias) == null){ + resultMap.put(alias, aliasMap.get(alias)); + } + } + } + } + + return resultMap; + } } diff -r f1eec65aaede -r 268b8ede3928 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java Thu Jun 17 11:41:12 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java Thu Jun 17 14:00:47 2010 -0500 @@ -27,4 +27,6 @@ */ public String getDefaultDefFileDirectoryName(); + public String getConfigurationErrorMessage(); + } diff -r f1eec65aaede -r 268b8ede3928 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Thu Jun 17 11:41:12 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Thu Jun 17 14:00:47 2010 -0500 @@ -39,12 +39,19 @@ 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.ui.Messages; +import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; /** * @since 1.4 */ +@SuppressWarnings("restriction") public class SBSv2PlatformFilterComposite extends Composite { + // TODO: Temporary map. We need a way to ensure we only get the alias map + // when needed and that the data we are getting is properly cached to avoid + // having to run Raptor queries too often + private static HashMap aliasMap = new HashMap(); + private CheckboxTableViewer tableViewer; private Button refreshButton; @@ -104,13 +111,21 @@ SBSv2Utils.initDefaultConfigsToFilter(); - // TODO: Aliases need to be the union of all SDKs - HashMap aliasMap = new HashMap(); - try { - aliasMap = SBSv2QueryUtils.getAliasesForSDK(null); - } catch (SBSv2MinimumVersionException e) { - MessageDialog.openError(getShell(), "Minimum sbs version not met.", e.getMessage()); + if (aliasMap.size() == 0){ + try { + aliasMap = SBSv2QueryUtils.getCompleteAliasList(); + } catch (SBSv2MinimumVersionException e) { + // Force a scan for version in case system was updated + SDKCorePlugin.getSDKManager().getSBSv2Version(true); + try { + // try, try again... + aliasMap = SBSv2QueryUtils.getCompleteAliasList(); + } catch (SBSv2MinimumVersionException e2) { + MessageDialog.openError(getShell(), "Minimum sbs version not met.", e.getMessage()); + } + } } + List sbsAliases = new ArrayList(); for (String key : aliasMap.keySet()) sbsAliases.add(key); @@ -135,12 +150,12 @@ public void setDefaults(){ initTable(true); for (TableItem item : tableViewer.getTable().getItems()) { - if (item.getText().toLowerCase().startsWith("armv5_udeb") || - item.getText().toLowerCase().startsWith("armv5_urel") || - item.getText().toLowerCase().startsWith("armv5_udeb_gcce") || - item.getText().toLowerCase().startsWith("armv5_urel_gcce") || - item.getText().toLowerCase().startsWith("winscw_udeb") || - item.getText().toLowerCase().startsWith("winscw_urel")) { + if (item.getText().toLowerCase().equals("armv5_udeb") || + item.getText().toLowerCase().equals("armv5_urel") || + item.getText().toLowerCase().equals("armv5_udeb_gcce") || + item.getText().toLowerCase().equals("armv5_urel_gcce") || + item.getText().toLowerCase().equals("winscw_udeb") || + item.getText().toLowerCase().equals("winscw_urel")) { tableViewer.setChecked(item.getData(), true); } else { tableViewer.setChecked(item.getData(), false); diff -r f1eec65aaede -r 268b8ede3928 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Thu Jun 17 11:41:12 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Thu Jun 17 14:00:47 2010 -0500 @@ -25,6 +25,7 @@ import org.eclipse.jface.viewers.TreeNode; import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; +import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext; import com.nokia.carbide.cpp.sdk.core.ISDKManager; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; @@ -35,6 +36,7 @@ * A tree node representing a Symbian OS SDK. This node's children will be the * list of available build configurations. */ +@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 @@ -70,7 +72,14 @@ public String toString() { ISymbianBuildContext context = (ISymbianBuildContext)getValue(); String sdkId = context.getSDK().getUniqueId(); - return context.getDisplayString().replace("[" + sdkId + "]", ""); + String newDisplayString = context.getDisplayString().replace("[" + sdkId + "]", ""); + if (context instanceof ISBSv2BuildContext){ + ISBSv2BuildContext v2Context = (ISBSv2BuildContext)context; + if (v2Context.getConfigurationErrorMessage() != null && v2Context.getConfigurationErrorMessage().length() > 0){ + newDisplayString += " ERROR: " + v2Context.getConfigurationErrorMessage(); + } + } + return newDisplayString; } }; }