Refactor out BSF/SBV support from SBSv2 Builder data. Create new package for SBSv2Query APIs (moved from builder tests).
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/SBSv2QueryTests.java Mon Jun 14 12:00:29 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/SBSv2QueryTests.java Mon Jun 14 13:24:47 2010 -0500
@@ -23,9 +23,9 @@
import org.osgi.framework.Version;
-import com.nokia.carbide.cdt.builder.test.sandbox.ISBSv2ConfigData;
-import com.nokia.carbide.cdt.builder.test.sandbox.ISBSv2QueryData;
-import com.nokia.carbide.cdt.builder.test.sandbox.SBSv2QueryUtils;
+import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.ISBSv2ConfigData;
+import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.ISBSv2QueryData;
+import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2QueryUtils;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/sandbox/ISBSv2ConfigData.java Mon Jun 14 12:00:29 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Test the BldInfViewPathHelper class.
-*
-*/
-package com.nokia.carbide.cdt.builder.test.sandbox;
-
-import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
-
-/**
- * Data that describes the meaning of a single build configuration, as discovered by SBS
- *
- * @noimplement
- */
-public interface ISBSv2ConfigData {
-
- /**
- * Get the usable SBS build alias that can be used for the -c parameter
- * @return the unique build alias
- */
- String getBuildAlias();
-
- /**
- * Get the meaning (aka dotted name, component name) fo the build alias.
- * Can also be used as a -c argument in SBS
- * @return the meaning
- */
- String getMeaning();
-
- /**
- * Get the directory for a given SDK where binaries are output
- * @param sdk - use null if for base configuration
- * @return the portable OS string starting from /epoc32/
- */
- String getReleaseDirectory(ISymbianSDK sdk);
-
- /**
- * TODO: This API is not yet defined.
- * @param sdk
- * @return
- */
- ISBSv2ConfigPreprocessorInfo getBuildData(ISymbianSDK sdk);
-
- /**
- * Get the name of the folder where executable binaries are written (typically 'debug' or 'release')
- * @param sdk - use null for base configuration
- * @return string of folder name
- */
- String getTraditionalTarget(ISymbianSDK sdk);
-
- /**
- * Get the name of the folder where executable binaries are written (component before the target)
- * @param sdk - use null for base configuration
- * @return string of folder name
- */
- String getTraditionalPlatform(ISymbianSDK sdk);
-
- /**
- * Get the SDK for which this configuration was qeuried.
- * @return the SDK, or null if it's a base sbs configuration
- */
- ISymbianSDK getSupportingSDK();
-
-}
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/sandbox/ISBSv2ConfigPreprocessorInfo.java Mon Jun 14 12:00:29 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Test the BldInfViewPathHelper class.
-*
-*/
-package com.nokia.carbide.cdt.builder.test.sandbox;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-
-/**
- * TODO: This API is not yet developed
- *
- * @noimplement
- */
-public interface ISBSv2ConfigPreprocessorInfo {
-
- List<String> getMacroList();
-
- List<IPath> getSystemIncludes();
-
- IPath getVariantConfig();
-
- String getCompiler();
-
- IPath getCompilerPrefix();
-
- ISBSv2ConfigData getSBSv2QueryConfigData();
-
-}
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/sandbox/ISBSv2QueryData.java Mon Jun 14 12:00:29 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Test the BldInfViewPathHelper class.
-*
-*/
-package com.nokia.carbide.cdt.builder.test.sandbox;
-
-import java.util.HashMap;
-import java.util.List;
-
-import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
-
-/**
- * Interface that wraps all queries to the Symbian Build System (SBSv2/Raptor)
- *
- * @noimplement
- */
-public interface ISBSv2QueryData {
-
- /**
- * For given SDK, add an SBS build configuration
- * @param sdk - use null if base SBS data
- * @param configData - The configuration to add
- */
- void addConfigurationData(ISymbianSDK sdk, ISBSv2ConfigData configData);
-
- /**
- * Get all usable SBS configurations for a given SDK, which is the union of
- * the SBS base configurations and SDK specific configurations.
- * @param sdk - should not be null
- * @return -The list of all usable SBS build configurations
- * @see {@link ISBSv2QueryData#getSDKSpecificConfigData(ISymbianSDK)}
- * @see {@link ISBSv2QueryData#getBaseSBSConfigurations()}
- */
- List<ISBSv2ConfigData> getAllConfigurationsForSDK(ISymbianSDK sdk);
-
- /**
- * Get the SBS configurations that are defined only by the SDK.
- * This does not include configurations that have altered meanings,
- * rather they provide a new unique build alias that is not defined in the base SBS installation.
- * @param sdk - never null
- * @return The unique SBS configurations to a given SDK. An empty list of none.
- */
- List<ISBSv2ConfigData> getSDKSpecificConfigData(ISymbianSDK sdk);
-
- /**
- * Get the map of build alias to sbs configuration data that Raptor defines
- * without input from any SDK
- * @return a HashMap of SBS build alias to configuration data
- */
- HashMap<String, ISBSv2ConfigData> getBaseSBSConfigurations();
-
- /**
- * Get the product variant list for a given SDK
- * @param sdk - The SDK, should not be null
- * @return The list of product variants
- */
- List<String> getProductsForSDK(ISymbianSDK sdk);
-
- /**
- * Sets the product variant list by the SDK. Products are typically defined
- * under /epoc32/sbs_config/variant_configurations.xml
- * @param sdk - The SDK, must not be null
- * @param products - The list of build variants that can be applied to any build alias or meaning
- */
- void addProductListForSDK(ISymbianSDK sdk, List<String> products);
-
- /**
- * Find SBS configuration data for a single build configuration.
- * @param sdk - The SDK that contains the build configuration. Null for a base configuration
- * @param string - The build alias (e.g. armv5_udeb)
- * @return SBS configuration data, or null if not found
- */
- ISBSv2ConfigData getSBSConfigByAlias(ISymbianSDK sdk, String alias);
-
- /**
- * Find SBS configuration data for a single build configuration.
- * @param sdk - The SDK that contains the build configuration. Null for a base configuration
- * @param string - The build meaning or dotted name (e.g. arm.v5.udeb.rvct2_2)
- * @return SBS configuration data, or null if not found
- */
- ISBSv2ConfigData getSBSConfigByMeaning(ISymbianSDK sdk, String meaning);
-}
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/sandbox/SBSv2ConfigData.java Mon Jun 14 12:00:29 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Test the BldInfViewPathHelper class.
-*
-*/
-package com.nokia.carbide.cdt.builder.test.sandbox;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
-
-public class SBSv2ConfigData implements ISBSv2ConfigData {
-
- /** The supporting SDK. May be null if it's a base configuration */
- ISymbianSDK sdk;
-
- /**
- * A unique build alias. There can only be one alias definition, but an SDK can change the meaning of the alias
- */
- String buildAlias;
- /*
- * The dotted name for the alias. One build alias can have multiple meanings, each defined in an SDK
- */
- String meaning;
-
- String target = null;
- String platform = null;
- String releaseDirectory = null;
-
- public SBSv2ConfigData(String buildAlias, String meaning, ISymbianSDK sdk){
- this.buildAlias = buildAlias;
- this.meaning = meaning;
- if (sdk != null){
- this.sdk = sdk;
- }
- }
-
- public String getBuildAlias() {
- return buildAlias;
- }
-
- public String getMeaning() {
- return meaning;
- }
-
-
- public String getReleaseDirectory(ISymbianSDK sdk) {
- if (releaseDirectory == null){
- initDefaultConfigTargetInfo(sdk);
- }
- return releaseDirectory;
- }
-
- private void initDefaultConfigTargetInfo(ISymbianSDK sdk) {
- List<String> aliasOrMeaningArray = new ArrayList<String>();
- aliasOrMeaningArray.add(buildAlias);
- HashMap <String, String> configResponse = SBSv2QueryUtils.queryConfigTargetInfo(aliasOrMeaningArray, sdk);
- String releaseTree = configResponse.get(meaning);
- if (releaseTree == null){
- // TODO: Throw Exception
- return;
- }
- IPath releasePath = new Path(releaseTree);
- int epoc32SegmentIndex = 0;
- for (String segment : releasePath.segments()){
- if (segment.toLowerCase().equals("epoc32"))
- break;
- epoc32SegmentIndex++;
- }
- platform = releasePath.segment(epoc32SegmentIndex+2);
- target = releasePath.segment(epoc32SegmentIndex+3);
- String device = releasePath.getDevice();
- releaseDirectory = releasePath.removeFirstSegments(epoc32SegmentIndex).toPortableString();
- releaseDirectory = releaseDirectory.replace(device, "");
-
- }
-
- public ISBSv2ConfigPreprocessorInfo getBuildData(ISymbianSDK sdk) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTraditionalTarget(ISymbianSDK sdk) {
- if (target == null){
- initDefaultConfigTargetInfo(sdk);
- }
-
- return target;
- }
-
- public String getTraditionalPlatform(ISymbianSDK sdk) {
- if (platform == null){
- initDefaultConfigTargetInfo(sdk);
- }
-
- return platform;
- }
-
- public String toString(){
- return "Alias = " + buildAlias + " : Meaning = " + meaning;
- }
-
- public ISymbianSDK getSupportingSDK() {
- return sdk;
- }
-
-
-}
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/sandbox/SBSv2QueryData.java Mon Jun 14 12:00:29 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Test the BldInfViewPathHelper class.
-*
-*/
-package com.nokia.carbide.cdt.builder.test.sandbox;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
-
-public class SBSv2QueryData implements ISBSv2QueryData {
-
- /** alias to ISBSv2ConfigData - These are the standard build configs defined by Raptor, and are treated as virtual by this API */
- HashMap<String, ISBSv2ConfigData> baseSBSConfigs = new HashMap<String, ISBSv2ConfigData>();
- /** SDK ==> ISBSv2ConfigData : Contains all the SBS configs particular to a single SDK */
- HashMap<ISymbianSDK, List<ISBSv2ConfigData>> sbsSDKBuildConfigMap = new HashMap<ISymbianSDK, List<ISBSv2ConfigData>>();
- HashMap<ISymbianSDK, List<String>> sdkProductVariantList = new HashMap<ISymbianSDK, List<String>>();
-
- public void addConfigurationData(ISymbianSDK sdk, ISBSv2ConfigData configData) {
-
- if (sdk == null){
- baseSBSConfigs.put(configData.getBuildAlias(), configData);
- }
-
- List<ISBSv2ConfigData> configDataForSDK = sbsSDKBuildConfigMap.get(sdk);
-
- if (configDataForSDK == null){
- // This SDK does not exist, create the first entry
- configDataForSDK = new ArrayList<ISBSv2ConfigData>();
- configDataForSDK.add(configData);
- sbsSDKBuildConfigMap.put(sdk, configDataForSDK);
- return;
- }
-
- configDataForSDK.add(configData);
- }
-
- public HashMap<String, ISBSv2ConfigData> getBaseSBSConfigurations() {
- return baseSBSConfigs;
- }
-
- public List<ISBSv2ConfigData> getSDKSpecificConfigData(ISymbianSDK sdk) {
- List<ISBSv2ConfigData> sdkDefinedConfigs = new ArrayList<ISBSv2ConfigData>();
-
- for (ISBSv2ConfigData oneConfig : sbsSDKBuildConfigMap.get(sdk)){
- // check if the alias is already in the base list, if not add it
- boolean addConfigForReturn = true;
- for (String alias : baseSBSConfigs.keySet()){
- ISBSv2ConfigData baseConfig = baseSBSConfigs.get(alias);
- if (oneConfig.getBuildAlias().equals(baseConfig.getBuildAlias())){
- addConfigForReturn = false;
- break;
- }
- }
- if (addConfigForReturn){
- sdkDefinedConfigs.add(oneConfig);
- }
- }
-
- return sdkDefinedConfigs;
- }
-
- public List<ISBSv2ConfigData> getAllConfigurationsForSDK(ISymbianSDK sdk) {
- return sbsSDKBuildConfigMap.get(sdk);
- }
-
- public List<String> getProductsForSDK(ISymbianSDK sdk) {
- return sdkProductVariantList.get(sdk);
- }
-
- public void addProductListForSDK(ISymbianSDK sdk, List<String> products) {
- if (null == sdkProductVariantList.get(sdk) ||
- sdkProductVariantList.size() == 0){
-
- sdkProductVariantList.put(sdk, products);
- }
- }
-
- public ISBSv2ConfigData getSBSConfigByAlias(ISymbianSDK sdk, String alias) {
-
- if (sdk == null){
- return baseSBSConfigs.get(alias);
- } else {
- List<ISBSv2ConfigData> configListForSDK = sbsSDKBuildConfigMap.get(sdk);
-
- for (ISBSv2ConfigData config : configListForSDK){
- if (config.getBuildAlias().equals(alias)){
- return config;
- }
- }
- }
-
- return null;
- }
-
- public ISBSv2ConfigData getSBSConfigByMeaning(ISymbianSDK sdk, String meaning) {
- if (sdk == null){
- for (String aliasKey : baseSBSConfigs.keySet()){
- ISBSv2ConfigData config = baseSBSConfigs.get(aliasKey);
- if (config.getMeaning().equals(meaning)){
- return config;
- }
- }
- } else {
- List<ISBSv2ConfigData> configListForSDK = sbsSDKBuildConfigMap.get(sdk);
-
- for (ISBSv2ConfigData config : configListForSDK){
- if (config.getMeaning().equals(meaning)){
- return config;
- }
- }
- }
-
- return null;
- }
-
-}
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/sandbox/SBSv2QueryUtils.java Mon Jun 14 12:00:29 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,305 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Test the BldInfViewPathHelper class.
-*
-*/
-package com.nokia.carbide.cdt.builder.test.sandbox;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Properties;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.eclipse.cdt.utils.spawner.EnvironmentReader;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.helpers.DefaultHandler;
-
-import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
-import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
-import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
-import com.nokia.cpp.internal.api.utils.core.Logging;
-
-public class SBSv2QueryUtils {
-
- public static final String QUERY_PRODUCTS_COMMAND = "--query=products";
- public static final String QUERY_CONFIG_COMMAND = "--query=config";
- public static final String QUERY_COMMAND = "--query=aliases";
-
- public static ISBSv2QueryData queryAliasAndProductVariants() {
- List<String> argListConfigQuery = new ArrayList<String>();
- List<String> argListProductQuery = new ArrayList<String>();
- argListConfigQuery.add(QUERY_COMMAND);
- SBSv2QueryData sbsQueryData = new SBSv2QueryData();
-
- /////// Invoke Raptor once with no EPOCROOT
- Properties envVars = EnvironmentReader.getEnvVars();
- envVars.setProperty("EPOCROOT", "FOOBAR");
- String queryResult = getSBSQueryOutput(argListConfigQuery, createEnvStringList(envVars));
-
- HashMap<String, String> sbsAliasMap = parseQueryAliasResult(queryResult);
-
- for (String aliasKey : sbsAliasMap.keySet()){
- String meaning = sbsAliasMap.get(aliasKey);
- SBSv2ConfigData oneSBSConfig = new SBSv2ConfigData(aliasKey, meaning, null);
- sbsQueryData.addConfigurationData(null, oneSBSConfig);
- }
-
- /////// Do for each SDK to build up the alias list...
- for (ISymbianSDK sdk : SDKCorePlugin.getSDKManager().getSDKList()){
- IPath epocRoot = new Path(sdk.getEPOCROOT());
- if ((sdk.getOSVersion().getMajor() <= 9 && sdk.getOSVersion().getMinor() <5)
- || !epocRoot.toFile().exists()){
-
- continue; // skip it, the sdk is not supported or broken
- }
-
- envVars = EnvironmentReader.getEnvVars();
- envVars.setProperty("EPOCROOT", sdk.getEPOCROOT());
-
- queryResult = getSBSQueryOutput(argListConfigQuery, createEnvStringList(envVars));
-
- sbsAliasMap = parseQueryAliasResult(queryResult);
-
- for (String aliasKey : sbsAliasMap.keySet()){
- String meaning = sbsAliasMap.get(aliasKey);
- SBSv2ConfigData oneSBSConfig = new SBSv2ConfigData(aliasKey, meaning, sdk);
- sbsQueryData.addConfigurationData(sdk, oneSBSConfig);
- }
-
- // Now get the products for each SDK
- argListProductQuery.add(QUERY_PRODUCTS_COMMAND);
- queryResult = getSBSQueryOutput(argListProductQuery, createEnvStringList(envVars));
- List<String> productList = parseQueryProductsResults(queryResult);
- sbsQueryData.addProductListForSDK(sdk, productList);
- }
-
- return sbsQueryData;
- }
-
- public static HashMap<String, String> queryConfigTargetInfo(List<String> aliasOrMeaningArray, ISymbianSDK sdk){
-
- List<String> argListConfigQuery = new ArrayList<String>();
-
- for (String alias : aliasOrMeaningArray){
- argListConfigQuery.add(QUERY_CONFIG_COMMAND + "[" + alias + "]");
- }
-
- Properties envVars = null;
- if (sdk != null){
- File epocRoot = new File(sdk.getEPOCROOT());
- if (epocRoot.exists()){
- envVars = EnvironmentReader.getEnvVars();
- envVars.setProperty("EPOCROOT", sdk.getEPOCROOT());
- }
- }
- String queryResult = getSBSQueryOutput(argListConfigQuery, createEnvStringList(envVars));
-
- return parseQueryConfigResults(queryResult);
- }
-
- private static String[] createEnvStringList(Properties envProps) {
-
- if (envProps == null){
- return null;
- }
- String[] env = null;
- List<String> envList = new ArrayList<String>();
- Enumeration<?> names = envProps.propertyNames();
- if (names != null) {
- while (names.hasMoreElements()) {
- String key = (String) names.nextElement();
- envList.add(key + "=" + envProps.getProperty(key));
- }
- env = (String[]) envList.toArray(new String[envList.size()]);
- }
- return env;
- }
-
- private static String getSBSQueryOutput(List<String> queryCommandList, String[] env) {
- String overallOutput = "";
-
- Runtime rt = Runtime.getRuntime();
- IPath sbsPath = SBSv2Utils.getSBSPath();
- Process p = null;
- List<String> args = new ArrayList<String>();
- args.add(sbsPath.toOSString());
- args.addAll(queryCommandList);
- try {
- p = rt.exec(args.toArray(new String[args.size()]), env);
- } catch (IOException e) {
- // no such process, SBSv2 not available
- Logging.log(
- SDKCorePlugin.getDefault(),
- Logging.newSimpleStatus(
- 0,
- IStatus.WARNING,
- MessageFormat
- .format(
- "Could not find or launch Raptor script ''{0}''; SBSv2 support will not be available",
- sbsPath), e));
- }
- if (p != null) {
- BufferedReader br = new BufferedReader(new InputStreamReader(p
- .getInputStream()));
-
- String stdErrLine = null;
- try {
-
- // Only try for 30 seconds then bail in case Raptor hangs
- int maxTries = 60;
- int numTries = 0;
- while (numTries < maxTries) {
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- // ignore
- }
- if (br.ready()) {
- while ((stdErrLine = br.readLine()) != null) {
- overallOutput += stdErrLine;
- numTries = maxTries;
- }
-
- }
- numTries++;
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- return overallOutput;
- }
-
- private static HashMap<String, String> parseQueryAliasResult(String queryResult) {
- /* Alias to dotted name config */
- HashMap<String, String> sbsAliasMap = new HashMap<String, String>();
-
- try {
- Element root = null;
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- parser.setErrorHandler(new DefaultHandler());
-
- StringReader reader = new StringReader( queryResult );
- InputSource inputSource = new InputSource( reader );
- root = parser.parse(inputSource).getDocumentElement();
-
- NodeList children = root.getChildNodes();
- for (int i=0; i< children.getLength(); i++) {
- Node aliasNode = children.item(i);
- if (aliasNode.getNodeName().equals("alias")){
- NamedNodeMap meaning = aliasNode.getAttributes();
- String dottedName = meaning.getNamedItem("meaning").getNodeValue();
- String alias = meaning.getNamedItem("name").getNodeValue();
- //System.out.println("ALIAS QUERY ==> " + dottedName + " <==> " + alias);
- sbsAliasMap.put(alias, dottedName);
- }
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- Logging.log(SDKCorePlugin.getDefault(), Logging.newStatus(SDKCorePlugin.getDefault(), e));
- }
-
-
- return sbsAliasMap;
- }
-
- private static HashMap<String, String> parseQueryConfigResults(String queryResult) {
- /* Alias to output directory */
- HashMap<String, String> sbsAliasMap = new HashMap<String, String>();
-
- try {
- Element root = null;
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- parser.setErrorHandler(new DefaultHandler());
-
- StringReader reader = new StringReader( queryResult );
- InputSource inputSource = new InputSource( reader );
- root = parser.parse(inputSource).getDocumentElement();
-
- NodeList children = root.getChildNodes();
- for (int i=0; i< children.getLength(); i++) {
- Node aliasNode = children.item(i);
- if (aliasNode.getNodeName().equals("config")){
- NamedNodeMap meaning = aliasNode.getAttributes();
- String outputpath = meaning.getNamedItem("outputpath").getNodeValue();
- String fullName = meaning.getNamedItem("fullname").getNodeValue();
- //System.out.println("ALIAS QUERY ==> " + dottedName + " <==> " + alias);
- sbsAliasMap.put(fullName, outputpath);
- }
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- Logging.log(SDKCorePlugin.getDefault(), Logging.newStatus(SDKCorePlugin.getDefault(), e));
- }
-
-
- return sbsAliasMap;
- }
-
- private static List<String> parseQueryProductsResults(String queryResult) {
- List<String> productList = new ArrayList<String>();
-
- try {
- Element root = null;
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- parser.setErrorHandler(new DefaultHandler());
-
- StringReader reader = new StringReader( queryResult );
- InputSource inputSource = new InputSource( reader );
- root = parser.parse(inputSource).getDocumentElement();
-
- NodeList children = root.getChildNodes();
- for (int i=0; i< children.getLength(); i++) {
- Node aliasNode = children.item(i);
- if (aliasNode.getNodeName().equals("product")){
- NamedNodeMap productAttribs = aliasNode.getAttributes();
- String name = productAttribs.getNamedItem("name").getNodeValue();
- //System.out.println("ALIAS QUERY ==> " + dottedName + " <==> " + alias);
- productList.add(name);
- }
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- Logging.log(SDKCorePlugin.getDefault(), Logging.newStatus(SDKCorePlugin.getDefault(), e));
- }
-
- return productList;
- }
-
-
-
-
-}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/DefaultMMPViewConfiguration.java Mon Jun 14 12:00:29 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/DefaultMMPViewConfiguration.java Mon Jun 14 13:24:47 2010 -0500
@@ -64,9 +64,9 @@
return true;
}
- public String getDefaultDefFileBase(boolean isASSP) {
+ public String getDefaultDefFileBase() {
if (context != null)
- return context.getDefaultDefFileDirectoryName(isASSP);
+ return context.getDefaultDefFileDirectoryName();
return null;
}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Mon Jun 14 12:00:29 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Mon Jun 14 13:24:47 2010 -0500
@@ -757,7 +757,8 @@
IPath path;
if (buildConfig.getBuildContext() instanceof ISBSv2BuildContext) {
ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
- releasePlatform = sbsv2BuildInfo.getBSFCatalog().getReleasePlatform(buildConfig.getPlatformString());
+ // TODO: This will need to be the release folder name from the SBSv2Context. Could fail for a variant
+ releasePlatform = buildConfig.getPlatformString();
path = sdk.getReleaseRoot().append(releasePlatform.toLowerCase()).append(buildConfig.getTargetString().toLowerCase());
} else {
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Mon Jun 14 12:00:29 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Mon Jun 14 13:24:47 2010 -0500
@@ -204,14 +204,11 @@
IBSFPlatform platform = null;
ISBVPlatform sbvPlat = null;
if (context instanceof ISBSv1BuildContext) {
+ // SBSv1 only
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
platform = sbsv1BuildInfo.getBSFCatalog().findPlatform(carbideBuildConfig.getPlatformString());
sbvPlat = sbsv1BuildInfo.getSBVCatalog().findPlatform(carbideBuildConfig.getPlatformString());
- } else {
- ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
- platform = sbsv2BuildInfo.getBSFCatalog().findPlatform(carbideBuildConfig.getPlatformString());
- sbvPlat = sbsv2BuildInfo.getSBVCatalog().findPlatform(carbideBuildConfig.getPlatformString());
- }
+ }
if (platform != null) {
IPath[] systemIncludePaths = platform.getSystemIncludePaths();
for (IPath path : systemIncludePaths) {
--- a/core/com.nokia.carbide.cpp.sdk.core/META-INF/MANIFEST.MF Mon Jun 14 12:00:29 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/META-INF/MANIFEST.MF Mon Jun 14 13:24:47 2010 -0500
@@ -17,6 +17,7 @@
com.nokia.cpp.utils.ui
Bundle-ActivationPolicy: lazy
Export-Package: com.nokia.carbide.cpp.internal.api.sdk;x-friends:="com.nokia.carbide.cpp.sdk.core.test",
+ com.nokia.carbide.cpp.internal.api.sdk.sbsv2;x-friends:="com.nokia.carbide.cdt.builder.test",
com.nokia.carbide.cpp.internal.sdk.core.gen.Devices;x-friends:="com.nokia.carbide.cpp.sdk.core.test,com.nokia.carbide.cpp.sdk.ui",
com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.impl;x-friends:="com.nokia.carbide.cpp.sdk.core.test",
com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.util;x-friends:="com.nokia.carbide.cpp.sdk.core.test",
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java Mon Jun 14 12:00:29 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java Mon Jun 14 13:24:47 2010 -0500
@@ -219,7 +219,7 @@
return buildInfo;
}
- public String getDefaultDefFileDirectoryName(boolean isASSP) {
+ public String getDefaultDefFileDirectoryName() {
// TODO: How the ASSP option affects the path?
String dirName = getDefFileDirectoryNameForPlatform(platform);
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Mon Jun 14 12:00:29 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Mon Jun 14 13:24:47 2010 -0500
@@ -78,29 +78,12 @@
}
@Override
- public String getDefaultDefFileDirectoryName(boolean isASSP) {
+ public String getDefaultDefFileDirectoryName() {
// TOOD: THIS IS ABLD STUFF. isASSP does not belong with Raptor
// TODO: How the ASSP option affects the path?
String dirName = getDefFileDirectoryNameForPlatform(platform);
- if (dirName == null) {
- // check BSF's
- IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
- if (catalog != null) {
- for (IBSFPlatform plat : catalog.getPlatforms()) {
- if (plat.getName().compareToIgnoreCase(platform) == 0) {
- String mainPlatform = catalog.getReleasePlatform(platform);
- if (mainPlatform != null) {
- dirName = getDefFileDirectoryNameForPlatform(mainPlatform);
- if (dirName == null || dirName.length() < 1) {
- // fallback - all BSF's should be EABI anyway
- return "EABI"; //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
+ // TODO: Previously BSF's folder was EABI? What is it for SBSv2 variants?
if (dirName == null) {
// fallback for unknown cases
@@ -134,30 +117,7 @@
|| platform.equals(ARMV6_PLATFORM)
|| platform.equals(ARMV6_ABIV2_PLATFORM)) {
return getRVCTPrefixFilePath();
- } else {
- // check BSF's
- IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
- if (catalog != null) {
- for (IBSFPlatform plat : catalog.getPlatforms()) {
- if (plat.getName().compareToIgnoreCase(platform) == 0) {
- String mainPlatform = catalog.getReleasePlatform(platform);
- if (mainPlatform != null) {
- if (mainPlatform.equals(GCCE_PLATFORM)) {
- return getGCCEPrefixFilePath();
- } else if (mainPlatform.equals(ARMV5_PLATFORM)
- || mainPlatform.equals(ARMV5_ABIV2_PLATFORM)
- || mainPlatform.equals(ARMV6_PLATFORM)
- || mainPlatform.equals(ARMV6_ABIV2_PLATFORM)) {
- return getRVCTPrefixFilePath();
- } else {
- // fallback - all BSF's should be EABI anyway
- return getRVCTPrefixFilePath();
- }
- }
- }
- }
- }
- }
+ }
// fallback for WINSCW, MSVC, etc.
return null;
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv2BuildInfo.java Mon Jun 14 12:00:29 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv2BuildInfo.java Mon Jun 14 13:24:47 2010 -0500
@@ -17,8 +17,6 @@
import org.eclipse.core.runtime.IPath;
-import com.nokia.carbide.cpp.sdk.core.IBSFCatalog;
-import com.nokia.carbide.cpp.sdk.core.ISBVCatalog;
import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo;
/**
@@ -30,11 +28,6 @@
void clearPlatformMacros();
/**
- * Get the BSF catalog for a SDK.
- */
- IBSFCatalog getBSFCatalog();
-
- /**
* Returns the list of all platform macros for a SDK.
* <p>
* This is somewhat equivalent to calling "bldmake plat" on the command line
@@ -52,11 +45,6 @@
public IPath getPrefixFromVariantCfg();
/**
- * Get the Symbian Binary Variation (SBV) catalog for a SDK.
- */
- ISBVCatalog getSBVCatalog();
-
- /**
* Get a list of macros specific to the given target type, e.g. "__EXE__" or "__DLL__"
* @param targettype
* @return list of macro strings, may be empty
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Mon Jun 14 12:00:29 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Mon Jun 14 13:24:47 2010 -0500
@@ -199,14 +199,11 @@
ISBVPlatform sbvPlat = null;
ISDKBuildInfo buildInfo = sdk.getBuildInfo(builderId);
if (buildInfo instanceof ISBSv1BuildInfo) {
+ // SBSv1 only
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)buildInfo;
bsfPlat = sbsv1BuildInfo.getBSFCatalog().findPlatform(platformString);
sbvPlat = sbsv1BuildInfo.getSBVCatalog().findPlatform(platformString);
- } else {
- ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)buildInfo;
- bsfPlat = sbsv2BuildInfo.getBSFCatalog().findPlatform(platformString);
- sbvPlat = sbsv2BuildInfo.getSBVCatalog().findPlatform(platformString);
- }
+ }
if (bsfPlat != null) {
for (IPath path : bsfPlat.getSystemIncludePaths()) {
systemPaths.add(path.toFile());
@@ -376,14 +373,11 @@
ISBVPlatform sbvPlatform = null;
ISDKBuildInfo buildInfo = sdk.getBuildInfo(builderId);
if (buildInfo instanceof ISBSv1BuildInfo) {
+ // SBSv1 only
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)buildInfo;
bsfplatform = sbsv1BuildInfo.getBSFCatalog().findPlatform(platformString);
sbvPlatform = sbsv1BuildInfo.getSBVCatalog().findPlatform(platformString);
- } else {
- ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)buildInfo;
- bsfplatform = sbsv2BuildInfo.getBSFCatalog().findPlatform(platformString);
- sbvPlatform = sbsv2BuildInfo.getSBVCatalog().findPlatform(platformString);
- }
+ }
// look in the epoc32 directory of the SDK
IPath includePath = sdk.getIncludePath();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/ISBSv2ConfigData.java Mon Jun 14 13:24:47 2010 -0500
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Test the BldInfViewPathHelper class.
+*
+*/
+package com.nokia.carbide.cpp.internal.api.sdk.sbsv2;
+
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+
+/**
+ * Data that describes the meaning of a single build configuration, as discovered by SBS
+ *
+ * @noimplement
+ */
+public interface ISBSv2ConfigData {
+
+ /**
+ * Get the usable SBS build alias that can be used for the -c parameter
+ * @return the unique build alias
+ */
+ String getBuildAlias();
+
+ /**
+ * Get the meaning (aka dotted name, component name) fo the build alias.
+ * Can also be used as a -c argument in SBS
+ * @return the meaning
+ */
+ String getMeaning();
+
+ /**
+ * Get the directory for a given SDK where binaries are output
+ * @param sdk - use null if for base configuration
+ * @return the portable OS string starting from /epoc32/
+ */
+ String getReleaseDirectory(ISymbianSDK sdk);
+
+ /**
+ * TODO: This API is not yet defined.
+ * @param sdk
+ * @return
+ */
+ ISBSv2ConfigPreprocessorInfo getBuildData(ISymbianSDK sdk);
+
+ /**
+ * Get the name of the folder where executable binaries are written (typically 'debug' or 'release')
+ * @param sdk - use null for base configuration
+ * @return string of folder name
+ */
+ String getTraditionalTarget(ISymbianSDK sdk);
+
+ /**
+ * Get the name of the folder where executable binaries are written (component before the target)
+ * @param sdk - use null for base configuration
+ * @return string of folder name
+ */
+ String getTraditionalPlatform(ISymbianSDK sdk);
+
+ /**
+ * Get the SDK for which this configuration was qeuried.
+ * @return the SDK, or null if it's a base sbs configuration
+ */
+ ISymbianSDK getSupportingSDK();
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/ISBSv2ConfigPreprocessorInfo.java Mon Jun 14 13:24:47 2010 -0500
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Test the BldInfViewPathHelper class.
+*
+*/
+package com.nokia.carbide.cpp.internal.api.sdk.sbsv2;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * TODO: This API is not yet developed
+ *
+ * @noimplement
+ */
+public interface ISBSv2ConfigPreprocessorInfo {
+
+ List<String> getMacroList();
+
+ List<IPath> getSystemIncludes();
+
+ IPath getVariantConfig();
+
+ String getCompiler();
+
+ IPath getCompilerPrefix();
+
+ ISBSv2ConfigData getSBSv2QueryConfigData();
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/ISBSv2QueryData.java Mon Jun 14 13:24:47 2010 -0500
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Test the BldInfViewPathHelper class.
+*
+*/
+package com.nokia.carbide.cpp.internal.api.sdk.sbsv2;
+
+import java.util.HashMap;
+import java.util.List;
+
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+
+/**
+ * Interface that wraps all queries to the Symbian Build System (SBSv2/Raptor)
+ *
+ * @noimplement
+ */
+public interface ISBSv2QueryData {
+
+ /**
+ * For given SDK, add an SBS build configuration
+ * @param sdk - use null if base SBS data
+ * @param configData - The configuration to add
+ */
+ void addConfigurationData(ISymbianSDK sdk, ISBSv2ConfigData configData);
+
+ /**
+ * Get all usable SBS configurations for a given SDK, which is the union of
+ * the SBS base configurations and SDK specific configurations.
+ * @param sdk - should not be null
+ * @return -The list of all usable SBS build configurations
+ * @see {@link ISBSv2QueryData#getSDKSpecificConfigData(ISymbianSDK)}
+ * @see {@link ISBSv2QueryData#getBaseSBSConfigurations()}
+ */
+ List<ISBSv2ConfigData> getAllConfigurationsForSDK(ISymbianSDK sdk);
+
+ /**
+ * Get the SBS configurations that are defined only by the SDK.
+ * This does not include configurations that have altered meanings,
+ * rather they provide a new unique build alias that is not defined in the base SBS installation.
+ * @param sdk - never null
+ * @return The unique SBS configurations to a given SDK. An empty list of none.
+ */
+ List<ISBSv2ConfigData> getSDKSpecificConfigData(ISymbianSDK sdk);
+
+ /**
+ * Get the map of build alias to sbs configuration data that Raptor defines
+ * without input from any SDK
+ * @return a HashMap of SBS build alias to configuration data
+ */
+ HashMap<String, ISBSv2ConfigData> getBaseSBSConfigurations();
+
+ /**
+ * Get the product variant list for a given SDK
+ * @param sdk - The SDK, should not be null
+ * @return The list of product variants
+ */
+ List<String> getProductsForSDK(ISymbianSDK sdk);
+
+ /**
+ * Sets the product variant list by the SDK. Products are typically defined
+ * under /epoc32/sbs_config/variant_configurations.xml
+ * @param sdk - The SDK, must not be null
+ * @param products - The list of build variants that can be applied to any build alias or meaning
+ */
+ void addProductListForSDK(ISymbianSDK sdk, List<String> products);
+
+ /**
+ * Find SBS configuration data for a single build configuration.
+ * @param sdk - The SDK that contains the build configuration. Null for a base configuration
+ * @param string - The build alias (e.g. armv5_udeb)
+ * @return SBS configuration data, or null if not found
+ */
+ ISBSv2ConfigData getSBSConfigByAlias(ISymbianSDK sdk, String alias);
+
+ /**
+ * Find SBS configuration data for a single build configuration.
+ * @param sdk - The SDK that contains the build configuration. Null for a base configuration
+ * @param string - The build meaning or dotted name (e.g. arm.v5.udeb.rvct2_2)
+ * @return SBS configuration data, or null if not found
+ */
+ ISBSv2ConfigData getSBSConfigByMeaning(ISymbianSDK sdk, String meaning);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2ConfigData.java Mon Jun 14 13:24:47 2010 -0500
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Test the BldInfViewPathHelper class.
+*
+*/
+package com.nokia.carbide.cpp.internal.api.sdk.sbsv2;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+
+public class SBSv2ConfigData implements ISBSv2ConfigData {
+
+ /** The supporting SDK. May be null if it's a base configuration */
+ ISymbianSDK sdk;
+
+ /**
+ * A unique build alias. There can only be one alias definition, but an SDK can change the meaning of the alias
+ */
+ String buildAlias;
+ /*
+ * The dotted name for the alias. One build alias can have multiple meanings, each defined in an SDK
+ */
+ String meaning;
+
+ String target = null;
+ String platform = null;
+ String releaseDirectory = null;
+
+ public SBSv2ConfigData(String buildAlias, String meaning, ISymbianSDK sdk){
+ this.buildAlias = buildAlias;
+ this.meaning = meaning;
+ if (sdk != null){
+ this.sdk = sdk;
+ }
+ }
+
+ public String getBuildAlias() {
+ return buildAlias;
+ }
+
+ public String getMeaning() {
+ return meaning;
+ }
+
+
+ public String getReleaseDirectory(ISymbianSDK sdk) {
+ if (releaseDirectory == null){
+ initDefaultConfigTargetInfo(sdk);
+ }
+ return releaseDirectory;
+ }
+
+ private void initDefaultConfigTargetInfo(ISymbianSDK sdk) {
+ List<String> aliasOrMeaningArray = new ArrayList<String>();
+ aliasOrMeaningArray.add(buildAlias);
+ HashMap <String, String> configResponse = SBSv2QueryUtils.queryConfigTargetInfo(aliasOrMeaningArray, sdk);
+ String releaseTree = configResponse.get(meaning);
+ if (releaseTree == null){
+ // TODO: Throw Exception
+ return;
+ }
+ IPath releasePath = new Path(releaseTree);
+ int epoc32SegmentIndex = 0;
+ for (String segment : releasePath.segments()){
+ if (segment.toLowerCase().equals("epoc32"))
+ break;
+ epoc32SegmentIndex++;
+ }
+ platform = releasePath.segment(epoc32SegmentIndex+2);
+ target = releasePath.segment(epoc32SegmentIndex+3);
+ String device = releasePath.getDevice();
+ releaseDirectory = releasePath.removeFirstSegments(epoc32SegmentIndex).toPortableString();
+ releaseDirectory = releaseDirectory.replace(device, "");
+
+ }
+
+ public ISBSv2ConfigPreprocessorInfo getBuildData(ISymbianSDK sdk) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getTraditionalTarget(ISymbianSDK sdk) {
+ if (target == null){
+ initDefaultConfigTargetInfo(sdk);
+ }
+
+ return target;
+ }
+
+ public String getTraditionalPlatform(ISymbianSDK sdk) {
+ if (platform == null){
+ initDefaultConfigTargetInfo(sdk);
+ }
+
+ return platform;
+ }
+
+ public String toString(){
+ return "Alias = " + buildAlias + " : Meaning = " + meaning;
+ }
+
+ public ISymbianSDK getSupportingSDK() {
+ return sdk;
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryData.java Mon Jun 14 13:24:47 2010 -0500
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Test the BldInfViewPathHelper class.
+*
+*/
+package com.nokia.carbide.cpp.internal.api.sdk.sbsv2;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+
+public class SBSv2QueryData implements ISBSv2QueryData {
+
+ /** alias to ISBSv2ConfigData - These are the standard build configs defined by Raptor, and are treated as virtual by this API */
+ HashMap<String, ISBSv2ConfigData> baseSBSConfigs = new HashMap<String, ISBSv2ConfigData>();
+ /** SDK ==> ISBSv2ConfigData : Contains all the SBS configs particular to a single SDK */
+ HashMap<ISymbianSDK, List<ISBSv2ConfigData>> sbsSDKBuildConfigMap = new HashMap<ISymbianSDK, List<ISBSv2ConfigData>>();
+ HashMap<ISymbianSDK, List<String>> sdkProductVariantList = new HashMap<ISymbianSDK, List<String>>();
+
+ public void addConfigurationData(ISymbianSDK sdk, ISBSv2ConfigData configData) {
+
+ if (sdk == null){
+ baseSBSConfigs.put(configData.getBuildAlias(), configData);
+ }
+
+ List<ISBSv2ConfigData> configDataForSDK = sbsSDKBuildConfigMap.get(sdk);
+
+ if (configDataForSDK == null){
+ // This SDK does not exist, create the first entry
+ configDataForSDK = new ArrayList<ISBSv2ConfigData>();
+ configDataForSDK.add(configData);
+ sbsSDKBuildConfigMap.put(sdk, configDataForSDK);
+ return;
+ }
+
+ configDataForSDK.add(configData);
+ }
+
+ public HashMap<String, ISBSv2ConfigData> getBaseSBSConfigurations() {
+ return baseSBSConfigs;
+ }
+
+ public List<ISBSv2ConfigData> getSDKSpecificConfigData(ISymbianSDK sdk) {
+ List<ISBSv2ConfigData> sdkDefinedConfigs = new ArrayList<ISBSv2ConfigData>();
+
+ for (ISBSv2ConfigData oneConfig : sbsSDKBuildConfigMap.get(sdk)){
+ // check if the alias is already in the base list, if not add it
+ boolean addConfigForReturn = true;
+ for (String alias : baseSBSConfigs.keySet()){
+ ISBSv2ConfigData baseConfig = baseSBSConfigs.get(alias);
+ if (oneConfig.getBuildAlias().equals(baseConfig.getBuildAlias())){
+ addConfigForReturn = false;
+ break;
+ }
+ }
+ if (addConfigForReturn){
+ sdkDefinedConfigs.add(oneConfig);
+ }
+ }
+
+ return sdkDefinedConfigs;
+ }
+
+ public List<ISBSv2ConfigData> getAllConfigurationsForSDK(ISymbianSDK sdk) {
+ return sbsSDKBuildConfigMap.get(sdk);
+ }
+
+ public List<String> getProductsForSDK(ISymbianSDK sdk) {
+ return sdkProductVariantList.get(sdk);
+ }
+
+ public void addProductListForSDK(ISymbianSDK sdk, List<String> products) {
+ if (null == sdkProductVariantList.get(sdk) ||
+ sdkProductVariantList.size() == 0){
+
+ sdkProductVariantList.put(sdk, products);
+ }
+ }
+
+ public ISBSv2ConfigData getSBSConfigByAlias(ISymbianSDK sdk, String alias) {
+
+ if (sdk == null){
+ return baseSBSConfigs.get(alias);
+ } else {
+ List<ISBSv2ConfigData> configListForSDK = sbsSDKBuildConfigMap.get(sdk);
+
+ for (ISBSv2ConfigData config : configListForSDK){
+ if (config.getBuildAlias().equals(alias)){
+ return config;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public ISBSv2ConfigData getSBSConfigByMeaning(ISymbianSDK sdk, String meaning) {
+ if (sdk == null){
+ for (String aliasKey : baseSBSConfigs.keySet()){
+ ISBSv2ConfigData config = baseSBSConfigs.get(aliasKey);
+ if (config.getMeaning().equals(meaning)){
+ return config;
+ }
+ }
+ } else {
+ List<ISBSv2ConfigData> configListForSDK = sbsSDKBuildConfigMap.get(sdk);
+
+ for (ISBSv2ConfigData config : configListForSDK){
+ if (config.getMeaning().equals(meaning)){
+ return config;
+ }
+ }
+ }
+
+ return null;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java Mon Jun 14 13:24:47 2010 -0500
@@ -0,0 +1,305 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Test the BldInfViewPathHelper class.
+*
+*/
+package com.nokia.carbide.cpp.internal.api.sdk.sbsv2;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Properties;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.eclipse.cdt.utils.spawner.EnvironmentReader;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
+import com.nokia.cpp.internal.api.utils.core.Logging;
+
+public class SBSv2QueryUtils {
+
+ public static final String QUERY_PRODUCTS_COMMAND = "--query=products";
+ public static final String QUERY_CONFIG_COMMAND = "--query=config";
+ public static final String QUERY_COMMAND = "--query=aliases";
+
+ public static ISBSv2QueryData queryAliasAndProductVariants() {
+ List<String> argListConfigQuery = new ArrayList<String>();
+ List<String> argListProductQuery = new ArrayList<String>();
+ argListConfigQuery.add(QUERY_COMMAND);
+ SBSv2QueryData sbsQueryData = new SBSv2QueryData();
+
+ /////// Invoke Raptor once with no EPOCROOT
+ Properties envVars = EnvironmentReader.getEnvVars();
+ envVars.setProperty("EPOCROOT", "FOOBAR");
+ String queryResult = getSBSQueryOutput(argListConfigQuery, createEnvStringList(envVars));
+
+ HashMap<String, String> sbsAliasMap = parseQueryAliasResult(queryResult);
+
+ for (String aliasKey : sbsAliasMap.keySet()){
+ String meaning = sbsAliasMap.get(aliasKey);
+ SBSv2ConfigData oneSBSConfig = new SBSv2ConfigData(aliasKey, meaning, null);
+ sbsQueryData.addConfigurationData(null, oneSBSConfig);
+ }
+
+ /////// Do for each SDK to build up the alias list...
+ for (ISymbianSDK sdk : SDKCorePlugin.getSDKManager().getSDKList()){
+ IPath epocRoot = new Path(sdk.getEPOCROOT());
+ if ((sdk.getOSVersion().getMajor() <= 9 && sdk.getOSVersion().getMinor() <5)
+ || !epocRoot.toFile().exists()){
+
+ continue; // skip it, the sdk is not supported or broken
+ }
+
+ envVars = EnvironmentReader.getEnvVars();
+ envVars.setProperty("EPOCROOT", sdk.getEPOCROOT());
+
+ queryResult = getSBSQueryOutput(argListConfigQuery, createEnvStringList(envVars));
+
+ sbsAliasMap = parseQueryAliasResult(queryResult);
+
+ for (String aliasKey : sbsAliasMap.keySet()){
+ String meaning = sbsAliasMap.get(aliasKey);
+ SBSv2ConfigData oneSBSConfig = new SBSv2ConfigData(aliasKey, meaning, sdk);
+ sbsQueryData.addConfigurationData(sdk, oneSBSConfig);
+ }
+
+ // Now get the products for each SDK
+ argListProductQuery.add(QUERY_PRODUCTS_COMMAND);
+ queryResult = getSBSQueryOutput(argListProductQuery, createEnvStringList(envVars));
+ List<String> productList = parseQueryProductsResults(queryResult);
+ sbsQueryData.addProductListForSDK(sdk, productList);
+ }
+
+ return sbsQueryData;
+ }
+
+ public static HashMap<String, String> queryConfigTargetInfo(List<String> aliasOrMeaningArray, ISymbianSDK sdk){
+
+ List<String> argListConfigQuery = new ArrayList<String>();
+
+ for (String alias : aliasOrMeaningArray){
+ argListConfigQuery.add(QUERY_CONFIG_COMMAND + "[" + alias + "]");
+ }
+
+ Properties envVars = null;
+ if (sdk != null){
+ File epocRoot = new File(sdk.getEPOCROOT());
+ if (epocRoot.exists()){
+ envVars = EnvironmentReader.getEnvVars();
+ envVars.setProperty("EPOCROOT", sdk.getEPOCROOT());
+ }
+ }
+ String queryResult = getSBSQueryOutput(argListConfigQuery, createEnvStringList(envVars));
+
+ return parseQueryConfigResults(queryResult);
+ }
+
+ private static String[] createEnvStringList(Properties envProps) {
+
+ if (envProps == null){
+ return null;
+ }
+ String[] env = null;
+ List<String> envList = new ArrayList<String>();
+ Enumeration<?> names = envProps.propertyNames();
+ if (names != null) {
+ while (names.hasMoreElements()) {
+ String key = (String) names.nextElement();
+ envList.add(key + "=" + envProps.getProperty(key));
+ }
+ env = (String[]) envList.toArray(new String[envList.size()]);
+ }
+ return env;
+ }
+
+ private static String getSBSQueryOutput(List<String> queryCommandList, String[] env) {
+ String overallOutput = "";
+
+ Runtime rt = Runtime.getRuntime();
+ IPath sbsPath = SBSv2Utils.getSBSPath();
+ Process p = null;
+ List<String> args = new ArrayList<String>();
+ args.add(sbsPath.toOSString());
+ args.addAll(queryCommandList);
+ try {
+ p = rt.exec(args.toArray(new String[args.size()]), env);
+ } catch (IOException e) {
+ // no such process, SBSv2 not available
+ Logging.log(
+ SDKCorePlugin.getDefault(),
+ Logging.newSimpleStatus(
+ 0,
+ IStatus.WARNING,
+ MessageFormat
+ .format(
+ "Could not find or launch Raptor script ''{0}''; SBSv2 support will not be available",
+ sbsPath), e));
+ }
+ if (p != null) {
+ BufferedReader br = new BufferedReader(new InputStreamReader(p
+ .getInputStream()));
+
+ String stdErrLine = null;
+ try {
+
+ // Only try for 30 seconds then bail in case Raptor hangs
+ int maxTries = 60;
+ int numTries = 0;
+ while (numTries < maxTries) {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ if (br.ready()) {
+ while ((stdErrLine = br.readLine()) != null) {
+ overallOutput += stdErrLine;
+ numTries = maxTries;
+ }
+
+ }
+ numTries++;
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ return overallOutput;
+ }
+
+ private static HashMap<String, String> parseQueryAliasResult(String queryResult) {
+ /* Alias to dotted name config */
+ HashMap<String, String> sbsAliasMap = new HashMap<String, String>();
+
+ try {
+ Element root = null;
+ DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
+
+ StringReader reader = new StringReader( queryResult );
+ InputSource inputSource = new InputSource( reader );
+ root = parser.parse(inputSource).getDocumentElement();
+
+ NodeList children = root.getChildNodes();
+ for (int i=0; i< children.getLength(); i++) {
+ Node aliasNode = children.item(i);
+ if (aliasNode.getNodeName().equals("alias")){
+ NamedNodeMap meaning = aliasNode.getAttributes();
+ String dottedName = meaning.getNamedItem("meaning").getNodeValue();
+ String alias = meaning.getNamedItem("name").getNodeValue();
+ //System.out.println("ALIAS QUERY ==> " + dottedName + " <==> " + alias);
+ sbsAliasMap.put(alias, dottedName);
+ }
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Logging.log(SDKCorePlugin.getDefault(), Logging.newStatus(SDKCorePlugin.getDefault(), e));
+ }
+
+
+ return sbsAliasMap;
+ }
+
+ private static HashMap<String, String> parseQueryConfigResults(String queryResult) {
+ /* Alias to output directory */
+ HashMap<String, String> sbsAliasMap = new HashMap<String, String>();
+
+ try {
+ Element root = null;
+ DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
+
+ StringReader reader = new StringReader( queryResult );
+ InputSource inputSource = new InputSource( reader );
+ root = parser.parse(inputSource).getDocumentElement();
+
+ NodeList children = root.getChildNodes();
+ for (int i=0; i< children.getLength(); i++) {
+ Node aliasNode = children.item(i);
+ if (aliasNode.getNodeName().equals("config")){
+ NamedNodeMap meaning = aliasNode.getAttributes();
+ String outputpath = meaning.getNamedItem("outputpath").getNodeValue();
+ String fullName = meaning.getNamedItem("fullname").getNodeValue();
+ //System.out.println("ALIAS QUERY ==> " + dottedName + " <==> " + alias);
+ sbsAliasMap.put(fullName, outputpath);
+ }
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Logging.log(SDKCorePlugin.getDefault(), Logging.newStatus(SDKCorePlugin.getDefault(), e));
+ }
+
+
+ return sbsAliasMap;
+ }
+
+ private static List<String> parseQueryProductsResults(String queryResult) {
+ List<String> productList = new ArrayList<String>();
+
+ try {
+ Element root = null;
+ DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
+
+ StringReader reader = new StringReader( queryResult );
+ InputSource inputSource = new InputSource( reader );
+ root = parser.parse(inputSource).getDocumentElement();
+
+ NodeList children = root.getChildNodes();
+ for (int i=0; i< children.getLength(); i++) {
+ Node aliasNode = children.item(i);
+ if (aliasNode.getNodeName().equals("product")){
+ NamedNodeMap productAttribs = aliasNode.getAttributes();
+ String name = productAttribs.getNamedItem("name").getNodeValue();
+ //System.out.println("ALIAS QUERY ==> " + dottedName + " <==> " + alias);
+ productList.add(name);
+ }
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Logging.log(SDKCorePlugin.getDefault(), Logging.newStatus(SDKCorePlugin.getDefault(), e));
+ }
+
+ return productList;
+ }
+
+
+
+
+}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Mon Jun 14 12:00:29 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Mon Jun 14 13:24:47 2010 -0500
@@ -28,8 +28,6 @@
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo;
import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
-import com.nokia.carbide.cpp.sdk.core.IBSFCatalog;
-import com.nokia.carbide.cpp.sdk.core.ISBVCatalog;
import com.nokia.carbide.cpp.sdk.core.ISDKManager;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
@@ -43,8 +41,6 @@
public class SBSv2BuildInfo implements ISBSv2BuildInfo {
private ISymbianSDK sdk;
- private IBSFCatalog bsfCatalog;
- private ISBVCatalog sbvCatalog;
private boolean wasScanned = false;
private Map<String, List<String>> cachedPlatformMacros = new HashMap<String, List<String>>();
@@ -63,15 +59,6 @@
return SBSv2Utils.getAllSBSv2BuildContexts(sdk);
}
- public IBSFCatalog getBSFCatalog() {
- synchronized (sdk) {
- if (bsfCatalog == null) {
- bsfCatalog = BSFCatalogFactory.createCatalog(sdk);
- }
- }
- return bsfCatalog;
- }
-
@Override
public List<ISymbianBuildContext> getFilteredBuildConfigurations() {
// This is probably a bug, but the filtering only uses SBSv1 preferences if SBSv1 is enabled...
@@ -86,12 +73,13 @@
}
public List<String> getPlatformMacros(String platform) {
+ // TODO: Need to get from Raptor Query
+ // TODO: Are these the metadata macros or compiler macros?
List<String> platformMacros = cachedPlatformMacros.get(platform.toUpperCase());
if (platformMacros == null) {
synchronized (cachedPlatformMacros) {
- IBSFCatalog bsfCatalog = getBSFCatalog();
ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
- platformMacros = sdkMgr.getSymbianMacroStore().getPlatformMacros(sdk.getOSVersion(), "", bsfCatalog, platform);
+ platformMacros = sdkMgr.getSymbianMacroStore().getPlatformMacros(sdk.getOSVersion(), "", null, platform);
cachedPlatformMacros.put(platform.toUpperCase(), platformMacros);
}
}
@@ -143,15 +131,6 @@
return null; // can't find the file...
}
- public ISBVCatalog getSBVCatalog() {
- synchronized (sdk) {
- if (sbvCatalog == null) {
- sbvCatalog = SBVCatalogFactory.createCatalog(sdk);
- }
- }
- return sbvCatalog;
- }
-
public List<String> getTargetTypeMacros(String targettype) {
// this is based on \epoc32\tools\trgtype.pm which changes from
// OS version to OS version, but largely remains constant with
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java Mon Jun 14 12:00:29 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISBSv2BuildContext.java Mon Jun 14 13:24:47 2010 -0500
@@ -17,4 +17,10 @@
*/
public String getConfigID();
+ /**
+ * Get the implicit directory searched for *.def files by the DEFFILE statement.
+ * @return bare directory name (e.g. 'BWINS', 'BMARM', 'EABI')
+ */
+ public String getDefaultDefFileDirectoryName();
+
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuildContext.java Mon Jun 14 12:00:29 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuildContext.java Mon Jun 14 13:24:47 2010 -0500
@@ -82,10 +82,9 @@
/**
* Get the implicit directory searched for *.def files by the DEFFILE statement.
- * @param isASSP true if targeting ASSP
* @return bare directory name (e.g. 'BWINS', 'BMARM', 'EABI')
*/
- public String getDefaultDefFileDirectoryName(boolean isASSP);
+ public String getDefaultDefFileDirectoryName();
/**
* Get the prefix file used at build time. This usually provides
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/BaseMMPViewTest.java Mon Jun 14 12:00:29 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/BaseMMPViewTest.java Mon Jun 14 13:24:47 2010 -0500
@@ -93,7 +93,7 @@
return parserConfig;
}
- public String getDefaultDefFileBase(boolean isASSP) {
+ public String getDefaultDefFileBase() {
return defFileBase;
}
public boolean isEmulatorBuild() {
@@ -117,7 +117,7 @@
public IViewParserConfiguration getViewParserConfiguration() {
return parserConfig;
}
- public String getDefaultDefFileBase(boolean isASSP) {
+ public String getDefaultDefFileBase() {
return defFileBase;
}
public boolean isEmulatorBuild() {
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestModelProvider.java Mon Jun 14 12:00:29 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestModelProvider.java Mon Jun 14 13:24:47 2010 -0500
@@ -121,7 +121,7 @@
return true;
}
- public String getDefaultDefFileBase(boolean isASSP) {
+ public String getDefaultDefFileBase() {
return "BWINS";
}
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestStandaloneModelProvider.java Mon Jun 14 12:00:29 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestStandaloneModelProvider.java Mon Jun 14 13:24:47 2010 -0500
@@ -123,7 +123,7 @@
return true;
}
- public String getDefaultDefFileBase(boolean isASSP) {
+ public String getDefaultDefFileBase() {
return "BWINS";
}
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/parser/TestSystemMMPs.java Mon Jun 14 12:00:29 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/parser/TestSystemMMPs.java Mon Jun 14 13:24:47 2010 -0500
@@ -123,7 +123,7 @@
return parserConfig;
}
- public String getDefaultDefFileBase(boolean isASSP) {
+ public String getDefaultDefFileBase() {
return "BWINS";
}
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/workspace/BaseProjectTests.java Mon Jun 14 12:00:29 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/workspace/BaseProjectTests.java Mon Jun 14 13:24:47 2010 -0500
@@ -134,7 +134,7 @@
return true;
}
- public String getDefaultDefFileBase(boolean isASSP) {
+ public String getDefaultDefFileBase() {
return defFileBase;
}
--- a/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/cpp/epoc/engine/model/mmp/IMMPViewConfiguration.java Mon Jun 14 12:00:29 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/cpp/epoc/engine/model/mmp/IMMPViewConfiguration.java Mon Jun 14 13:24:47 2010 -0500
@@ -31,12 +31,11 @@
/**
* Get the default directory used for .def file exports.
- * @param isASSP true if this is an ASSP build
* @return the name of the directory used for platform-specific defs
* (e.g. "BWINS", "EABI", ...). This directory, if present, is removed from
* the path before setting DEFFILE. May be null if unknown.
*/
- String getDefaultDefFileBase(boolean isASSP);
+ String getDefaultDefFileBase();
/**
* Tell if this is an emulator build. Used for .def filepath calculation.
--- a/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/model/mmp/MMPView.java Mon Jun 14 12:00:29 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/model/mmp/MMPView.java Mon Jun 14 13:24:47 2010 -0500
@@ -973,7 +973,7 @@
String theDefFile = singleArgumentSettings.get(EMMPStatement.DEFFILE);;
return convertMMPDefFileToProjectOrFullPath(
theDefFile, isDefFileInFixedDirectory(),
- viewConfiguration.getDefaultDefFileBase(isASSP()),
+ viewConfiguration.getDefaultDefFileBase(),
viewConfiguration.isEmulatorBuild());
}
@@ -989,7 +989,7 @@
//Check.checkState(ModelSynchronizer.FORCE_NEW_CONTENT_TO_MAIN_DOCUMENT);
IMMPViewConfiguration viewConfiguration = (IMMPViewConfiguration) getViewConfiguration();
String newDefFile = convertPhysicalFileToMMPDefFile(path,
- viewConfiguration.getDefaultDefFileBase(isASSP()),
+ viewConfiguration.getDefaultDefFileBase(),
viewConfiguration.isEmulatorBuild(),
isFixedDirectory);
singleArgumentSettings.put(EMMPStatement.DEFFILE, newDefFile);
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ImporterBuildTargetsPage.java Mon Jun 14 12:00:29 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ImporterBuildTargetsPage.java Mon Jun 14 13:24:47 2010 -0500
@@ -79,9 +79,8 @@
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
if (sbsv1BuildInfo != null) {
+ // SBSv1 only
bsfCatalog = sbsv1BuildInfo.getBSFCatalog();
- } else if (sbsv2BuildInfo != null) {
- bsfCatalog = sbsv2BuildInfo.getBSFCatalog();
}
if (sdkMgr.getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){
// Check and see if any of the configs in the SDK
@@ -139,12 +138,10 @@
ISymbianSDK sdk = currContext.getSDK();
IBSFCatalog bsfCatalog = null;
if (currContext instanceof ISBSv1BuildContext) {
+ // SBSv1 only
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
bsfCatalog = sbsv1BuildInfo.getBSFCatalog();
- } else {
- ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
- bsfCatalog = sbsv2BuildInfo.getBSFCatalog();
- }
+ }
if (sdkMgr.getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){
// this setting needs to be persisted.
settingsNeedUpdate = true;
--- a/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtImporterBuildTargetsPage.java Mon Jun 14 12:00:29 2010 -0500
+++ b/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtImporterBuildTargetsPage.java Mon Jun 14 13:24:47 2010 -0500
@@ -66,12 +66,10 @@
ISymbianSDK sdk = currContext.getSDK();
IBSFCatalog bsfCatalog = null;
if (currContext instanceof ISBSv1BuildContext) {
+ // SBSv1 only
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
bsfCatalog = sbsv1BuildInfo.getBSFCatalog();
- } else {
- ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
- bsfCatalog = sbsv2BuildInfo.getBSFCatalog();
- }
+ }
if (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0 || sdkMgr.getBSFScannerEnabled()){
// this setting needs to be persisted.
settingsNeedUpdate = true;