# HG changeset patch # User stechong # Date 1279831527 18000 # Node ID d7359f2d20806e46692c26497147ecc627a4302a # Parent 0d8b054f7f832c1c2c8e98f393782017dd948de7 Make sure we're getting the correct set of macros for each SBSv2 build context. diff -r 0d8b054f7f83 -r d7359f2d2080 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 Jul 22 15:40:20 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Thu Jul 22 15:45:27 2010 -0500 @@ -153,7 +153,7 @@ public List getCompilerMacros() { IPath prefixFile = getCompilerPrefixFile(); if (prefixFile == null || !prefixFile.toFile().exists()) { - return Collections.emptyList(); + return getCachedData().getCompilerMacros(null); } return getCachedData().getCompilerMacros(prefixFile); diff -r 0d8b054f7f83 -r d7359f2d2080 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Thu Jul 22 15:40:20 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Thu Jul 22 15:45:27 2010 -0500 @@ -87,7 +87,16 @@ * @return */ private static String getBuildContextKey(ISymbianBuildContext context) { - String key = context.getPlatformString() + "/" + context.getTargetString() + "/"; + String key; + if (context instanceof ISBSv2BuildContext) { + // use config ID instead of platform + target since + // platform and target can be the same for different build contexts + ISBSv2BuildContext v2Context = (ISBSv2BuildContext) context; + key = v2Context.getConfigID() + "/"; + } + else { + key = context.getPlatformString() + "/" + context.getTargetString() + "/"; + } ISymbianSDK sdk = context.getSDK(); if (sdk != null) key += sdk.getEPOCROOT(); @@ -285,7 +294,8 @@ // we assume that the prefix file will not change often, // (if at all) for a build context, so dump the cache if the prefix file changes. - if (compilerPrefixFile != null && !compilerPrefixFile.equals(prefixFile)) { + if (compilerPrefixFile != null && prefixFile != null && + !compilerPrefixFile.equals(prefixFile)) { compilerPrefixFileInfo = null; } @@ -342,12 +352,15 @@ if (context instanceof ISBSv2BuildContext) { // add macros from raptor query ISBSv2BuildContext v2Context = (ISBSv2BuildContext) context; - Map buildMacros = v2Context.getConfigQueryData().getBuildMacros(); - if (buildMacros != null) { - for (Iterator itr = buildMacros.keySet().iterator(); itr.hasNext(); ) { - String name = itr.next(); - String value = buildMacros.get(name); - macros.add(DefineFactory.createDefine(name, value)); + ISBSv2ConfigQueryData configData = v2Context.getConfigQueryData(); + if (configData != null) { + Map buildMacros = configData.getBuildMacros(); + if (buildMacros != null) { + for (Iterator itr = buildMacros.keySet().iterator(); itr.hasNext(); ) { + String name = itr.next(); + String value = buildMacros.get(name); + macros.add(DefineFactory.createDefine(name, value)); + } } } }