# HG changeset patch # User stechong # Date 1282690643 18000 # Node ID 5486b48b06ad0dc7fb842d3e26cecf2327f5e199 # Parent 717ae9e98feccb4ba36911acf144776fba76316c Filter SBSv2 build configurations for WINSCW targets based on emulator support in SDK. diff -r 717ae9e98fec -r 5486b48b06ad core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Tue Aug 24 08:56:19 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Tue Aug 24 17:57:23 2010 -0500 @@ -16,6 +16,7 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; @@ -34,6 +35,7 @@ import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2QueryUtils; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; import com.nokia.cpp.internal.api.utils.core.Logging; import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; @@ -46,7 +48,7 @@ public class SBSv2BuildInfo implements ISBSv2BuildInfo { private ISymbianSDK sdk; - private List sbsv2FilteredConetxts = new ArrayList(); + private List sbsv2FilteredContexts = new ArrayList(); private boolean wasScanned = false; /** from element from sbs --query=config[] */ private Map> cachedMetadataMacros = new HashMap>(); @@ -64,13 +66,13 @@ public List getAllBuildConfigurations() { // This really only applies to SBSv1. We never return the full list of configs for SBSv2, only the filtered ones - return sbsv2FilteredConetxts; + return sbsv2FilteredContexts; } public void clearDataFromBuildCache(){ aliasToMeaningMap.clear(); if (productList != null) productList.clear(); - sbsv2FilteredConetxts.clear(); + sbsv2FilteredContexts.clear(); cachedBuildMacros.clear(); cachedMetadataMacros.clear(); cachedVariantHRHFile = null; @@ -118,7 +120,7 @@ } } - return sbsv2FilteredConetxts; + return sbsv2FilteredContexts; } private void initSBSv2BuildContextList(List allowedConfigs) throws SBSv2MinimumVersionException { @@ -148,12 +150,12 @@ } List processedAliasList = new ArrayList(); - sbsv2FilteredConetxts.clear(); + sbsv2FilteredContexts.clear(); for (String alias : filteredAliasList) { SBSv2ConfigQueryData configQueryData = SBSv2QueryUtils.getConfigQueryDataForSDK(sdk, alias); if (configQueryData != null && configQueryData.getConfigurationErrorMessage().trim().length() == 0) { ISBSv2BuildContext sbsv2Context = new BuildContextSBSv2(sdk, alias, configQueryData); - sbsv2FilteredConetxts.add(sbsv2Context); + sbsv2FilteredContexts.add(sbsv2Context); processedAliasList.add(alias); } } @@ -177,10 +179,35 @@ } SBSv2ConfigQueryData configQueryData = new SBSv2ConfigQueryData(alias, meaning, configQueryXML); ISBSv2BuildContext sbsv2Context = new BuildContextSBSv2(sdk, alias, configQueryData); - sbsv2FilteredConetxts.add(sbsv2Context); + sbsv2FilteredContexts.add(sbsv2Context); SBSv2QueryUtils.storeConfigQueryDataForSDK(sdk, alias, configQueryData); } } + + checkWINSCWSupport(); + } + + private void checkWINSCWSupport() { + List contextList = new ArrayList(); + for (Iterator itr = sbsv2FilteredContexts.iterator(); itr.hasNext();) { + ISBSv2BuildContext context = (ISBSv2BuildContext) itr.next(); + if (context.getPlatformString().equalsIgnoreCase(ISBSv2BuildContext.TOOLCHAIN_WINSCW)) { + if (context.getTargetString().equalsIgnoreCase(ISymbianBuildContext.DEBUG_TARGET)) { + if (sdk.getSupportedFeatures().contains(ISymbianSDKFeatures.IS_WINSCW_UDEB_SUPPORTED)){ + contextList.add(context); + } + } + else + if (context.getTargetString().equalsIgnoreCase(ISymbianBuildContext.RELEASE_TARGET)) { + if (sdk.getSupportedFeatures().contains(ISymbianSDKFeatures.IS_WINSCW_UREL_SUPPORTED)){ + contextList.add(context); + } + } + } else { + contextList.add(context); + } + } + sbsv2FilteredContexts = contextList; } private String getMeaningForVariant(String alias) { @@ -203,11 +230,11 @@ if (platformMacros == null) { platformMacros = new HashMap(); synchronized (cachedMetadataMacros) { - if (sbsv2FilteredConetxts == null || sbsv2FilteredConetxts.size() == 0) { + if (sbsv2FilteredContexts == null || sbsv2FilteredContexts.size() == 0) { getFilteredBuildConfigurations(); } - if (sbsv2FilteredConetxts.size() > 0) { - for (ISymbianBuildContext context : sbsv2FilteredConetxts) { + if (sbsv2FilteredContexts.size() > 0) { + for (ISymbianBuildContext context : sbsv2FilteredContexts) { if (((ISBSv2BuildContext)context).getSBSv2Alias().equalsIgnoreCase(buildAlias)) { platformMacros.putAll(((ISBSv2BuildContext)context).getConfigQueryData().getMetaDataMacros()); } @@ -224,11 +251,11 @@ if (buildMacros == null) { buildMacros = new HashMap(); synchronized (cachedBuildMacros) { - if (sbsv2FilteredConetxts == null || sbsv2FilteredConetxts.size() == 0) { + if (sbsv2FilteredContexts == null || sbsv2FilteredContexts.size() == 0) { getFilteredBuildConfigurations(); } - if (sbsv2FilteredConetxts.size() > 0) { - for (ISymbianBuildContext context : sbsv2FilteredConetxts) { + if (sbsv2FilteredContexts.size() > 0) { + for (ISymbianBuildContext context : sbsv2FilteredContexts) { if (((ISBSv2BuildContext)context).getSBSv2Alias().equalsIgnoreCase(buildAlias)) { buildMacros.putAll(((ISBSv2BuildContext)context).getConfigQueryData().getBuildMacros()); } @@ -246,11 +273,11 @@ */ public IPath getPrefixFromVariantCfg(){ if (cachedVariantHRHFile == null) { - if (sbsv2FilteredConetxts == null || sbsv2FilteredConetxts.size() == 0) { + if (sbsv2FilteredContexts == null || sbsv2FilteredContexts.size() == 0) { getFilteredBuildConfigurations(); } - if (sbsv2FilteredConetxts.size() > 0) { - for (ISymbianBuildContext context : sbsv2FilteredConetxts) { + if (sbsv2FilteredContexts.size() > 0) { + for (ISymbianBuildContext context : sbsv2FilteredContexts) { String vStr = ((ISBSv2BuildContext)context).getConfigQueryData().getMetaDataVariantHRH(); if (vStr != null) { cachedVariantHRHFile = new Path(vStr);