Set error parser IDs based on compiler macros from Raptor config query.
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Thu Jul 15 23:28:04 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Mon Jul 19 21:06:20 2010 -0500
@@ -322,15 +322,14 @@
String plat = this.getPlatformString();
if (context instanceof ISBSv2BuildContext){
- // TODO: Getting the tool chain can actually come from the SBSv2 build context.
- // The metadata macros will tell what toolchain is being used (e.g. ARMCC, CW32, GCCE)
- if (((ISBSv2BuildContext)context).getSBSv2Alias().toUpperCase().contains(ISBSv2BuildContext.TOOLCHAIN_GCCE)){
+ String toolChain = ((ISBSv2BuildContext)context).getToolChain();
+ if (toolChain.equalsIgnoreCase(ISBSv2BuildContext.TOOLCHAIN_ARM)){
+ return ERROR_PARSERS_ARMVx;
+ } else if (toolChain.equalsIgnoreCase(ISBSv2BuildContext.TOOLCHAIN_GCCE)){
return ERROR_PARSERS_GCCE;
- } else if (((ISBSv2BuildContext)context).getSBSv2Alias().toUpperCase().contains(ISBSv2BuildContext.TOOLCHAIN_WINSCW)){
+ } else if (toolChain.equalsIgnoreCase(ISBSv2BuildContext.TOOLCHAIN_WINSCW)){
return ERROR_PARSERS_WINSCW;
- } else if (((ISBSv2BuildContext)context).getSBSv2Alias().toUpperCase().contains(ISBSv2BuildContext.TOOLCHAIN_ARM)){
- return ERROR_PARSERS_ARMVx;
- }
+ }
} else {
// SBSV1
if (plat.equals(ISBSv1BuildContext.EMULATOR_PLATFORM)){
--- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/TestSBSv2BuildContext.java Thu Jul 15 23:28:04 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/TestSBSv2BuildContext.java Mon Jul 19 21:06:20 2010 -0500
@@ -3,6 +3,7 @@
import java.io.File;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import junit.framework.TestCase;
@@ -84,6 +85,23 @@
// getCompilerMacros()
assertNotNull(context.getCompilerMacros());
+
+ // getToolChain()
+ String toolChain = context.getToolChain();
+ assertNotNull(toolChain);
+ Map<String, String> buildMacros = context.getConfigQueryData().getBuildMacros();
+ if (buildMacros != null) {
+ if (buildMacros.containsKey(ISBSv2BuildContext.MACRO_ARM)) {
+ assertTrue(toolChain.equals(ISBSv2BuildContext.TOOLCHAIN_ARM));
+ } else if (buildMacros.containsKey(ISBSv2BuildContext.MACRO_GCCE)) {
+ assertTrue(toolChain.equals(ISBSv2BuildContext.TOOLCHAIN_GCCE));
+ } else if (buildMacros.containsKey(ISBSv2BuildContext.MACRO_WINSCW)) {
+ assertTrue(toolChain.equals(ISBSv2BuildContext.TOOLCHAIN_WINSCW));
+ } else {
+ assertTrue(toolChain.equals(ISBSv2BuildContext.TOOLCHAIN_UNKNOWN));
+ }
+ }
+
}
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Thu Jul 15 23:28:04 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Mon Jul 19 21:06:20 2010 -0500
@@ -27,7 +27,7 @@
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
public class BuildContextSBSv2 implements ISBSv2BuildContext {
-
+
private String platform;
private String target;
private String sbsv2Alias;
@@ -261,7 +261,8 @@
}
private void setPlatformAndTargetFromOutputPath() {
- if (configQueryData.getOutputPathString() == null) {
+ String pathString = configQueryData.getOutputPathString();
+ if (pathString == null || pathString.length() == 0) {
platform = "";
target = "";
return;
@@ -305,7 +306,33 @@
return configQueryData;
}
+ @Override
public ISBSv2ConfigQueryData getConfigQueryData() {
return configQueryData;
}
+
+ @Override
+ public String getToolChain() {
+ Map<String, String> buildMacros = configQueryData.getBuildMacros();
+ if (buildMacros != null) {
+ // try to figure out the tool chain using macros from Raptor config query
+ if (buildMacros.containsKey(MACRO_ARM)) {
+ return TOOLCHAIN_ARM;
+ } else if (buildMacros.containsKey(MACRO_GCCE)) {
+ return TOOLCHAIN_GCCE;
+ } else if (buildMacros.containsKey(MACRO_WINSCW)) {
+ return TOOLCHAIN_WINSCW;
+ }
+ } else {
+ // if no macros available, use alais name instead
+ if (sbsv2Alias.toUpperCase().contains(TOOLCHAIN_ARM)) {
+ return TOOLCHAIN_ARM;
+ } else if (sbsv2Alias.toUpperCase().contains(TOOLCHAIN_GCCE)) {
+ return TOOLCHAIN_GCCE;
+ } else if (sbsv2Alias.toUpperCase().contains(TOOLCHAIN_WINSCW)) {
+ return TOOLCHAIN_WINSCW;
+ }
+ }
+ return TOOLCHAIN_UNKNOWN;
+ }
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java Thu Jul 15 23:28:04 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java Mon Jul 19 21:06:20 2010 -0500
@@ -5,9 +5,14 @@
public static final String BUILDER_ID = "com.nokia.carbide.builder.raptor";
- public static final String TOOLCHAIN_WINSCW = "WINSCW";
+ public static final String TOOLCHAIN_ARM = "ARM";
public static final String TOOLCHAIN_GCCE = "GCCE";
- public static final String TOOLCHAIN_ARM = "ARM";
+ public static final String TOOLCHAIN_WINSCW = "WINSCW";
+ public static final String TOOLCHAIN_UNKNOWN = "UNKNOWN";
+
+ public static final String MACRO_ARM = "__ARMCC__";
+ public static final String MACRO_GCCE = "__GCCE__";
+ public static final String MACRO_WINSCW = "__WINSCW__";
/**
* Retrieve the build-able configuration; a valid command that cab be passed with Raptor's -c parameter.
@@ -17,8 +22,8 @@
public String getSBSv2Alias();
/**
- * Get the unique configuration ID for the SBSv2 build configuration
- * @return
+ * Get the unique configuration ID for the SBSv2 build configuration.
+ * @return configuration ID
*/
public String getConfigID();
@@ -28,5 +33,16 @@
*/
public String getDefaultDefFileDirectoryName();
+ /**
+ * Get stored result from Raptor config query.
+ * @return ISBSv2ConfigQueryData object
+ */
public ISBSv2ConfigQueryData getConfigQueryData();
+
+ /**
+ * Get tool chain for the build context
+ * @return tool chain name (e.g. 'ARM', 'GCCE', 'WINSCW')
+ */
+ public String getToolChain();
+
}