core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java
author timkelly
Tue, 17 Aug 2010 15:50:47 -0700
branchC3_BUILDER_WORK
changeset 1847 5a696c4ef747
parent 1811 b1772bf1197b
child 1871 4d38e1ac1cff
permissions -rw-r--r--
more Linux related fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     1
package com.nokia.carbide.cpp.internal.api.sdk;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     2
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     3
import java.io.File;
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
     4
import java.text.MessageFormat;
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
     5
import java.util.ArrayList;
1678
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
     6
import java.util.Iterator;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     7
import java.util.List;
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
     8
import java.util.Map;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     9
1755
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1749
diff changeset
    10
import org.eclipse.cdt.core.settings.model.ICStorageElement;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    11
import org.eclipse.core.runtime.IPath;
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
    12
import org.eclipse.core.runtime.IStatus;
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    13
import org.eclipse.core.runtime.Path;
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
    14
import org.eclipse.jface.dialogs.MessageDialog;
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
    15
import org.eclipse.ui.PlatformUI;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    16
1811
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
    17
import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefineFactory;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    18
import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine;
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
    19
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2ConfigQueryData;
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
    20
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2MinimumVersionException;
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
    21
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2QueryUtils;
1420
9dfc6e3dc4b9 more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents: 1419
diff changeset
    22
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
    23
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    24
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
    25
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
1438
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
    26
import com.nokia.cpp.internal.api.utils.core.Check;
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
    27
import com.nokia.cpp.internal.api.utils.core.Logging;
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
    28
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    29
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    30
public class BuildContextSBSv2 implements ISBSv2BuildContext {
1643
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
    31
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    32
	private String platform;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    33
	private String target;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    34
	private String sbsv2Alias;
1433
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
    35
	private ISymbianSDK sdk;
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
    36
	private String displayString;
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
    37
	private String configID;  // cconfiguration 'id' attribute from .cproject
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    38
	
1847
5a696c4ef747 more Linux related fixes
timkelly
parents: 1811
diff changeset
    39
	private boolean reportedSBSVersionError;
5a696c4ef747 more Linux related fixes
timkelly
parents: 1811
diff changeset
    40
	
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    41
	// Raptor config query data
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
    42
	private ISBSv2ConfigQueryData configQueryData;
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    43
	
1764
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
    44
	// cconfiguration data store
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
    45
	private SBSv2BuilderInfo sbsv2BuildInfo;
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
    46
	
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
    47
	private IPath cachedVariantHRHFile = null;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
    48
	
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
    49
	public BuildContextSBSv2(ISymbianSDK sdk, String platform, String target, String alias, String displayString, String configID) {
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
    50
		this.sdk = sdk;
1683
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    51
		if (platform == null){
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    52
			this.platform = "unknown_platform";
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    53
		} else {
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    54
			this.platform = platform.toUpperCase();
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    55
		}
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    56
		
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    57
		if (target == null){
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    58
			this.target = "unknown_target";
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    59
		} else {
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    60
			this.target = target.toUpperCase();
659fdb7ee701 simplify building of filtered alias lists from sbsv2 filtering prefs. Fix NPE when creating a build config that has errors and not platform or target.
timkelly
parents: 1678
diff changeset
    61
		}
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
    62
		this.sbsv2Alias = alias;
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
    63
		this.displayString = displayString;
1433
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
    64
		this.configID = configID;
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
    65
		this.configQueryData = setConfigQueryData(sdk, alias);
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    66
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    67
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
    68
	public BuildContextSBSv2(ISymbianSDK sdk, String alias, ISBSv2ConfigQueryData configData) {
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    69
		this.sdk = sdk;
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    70
		this.sbsv2Alias = alias;
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
    71
		this.configQueryData = configData;
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
    72
		setPlatformAndTargetFromOutputPath();
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    73
		this.configID = ISBSv2BuildContext.BUILDER_ID + "." + sbsv2Alias + "." + sdk.getUniqueId();
1491
268b8ede3928 Update the SBSv2 filtering pref options from the Raptor alias query (union of all available build configs from Raptor).
timkelly
parents: 1480
diff changeset
    74
		this.displayString = sbsv2Alias + " [" + sdk.getUniqueId() + "]"; 
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    75
	}
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    76
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    77
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    78
	public ISymbianSDK getSDK() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    79
		return sdk;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    80
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    81
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    82
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    83
	public String getPlatformString() {
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    84
		
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    85
		if (platform == null){
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
    86
			return configQueryData.getConfigurationErrorMessage();
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    87
		}
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    88
		
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    89
		if (platform.contains(".")){
1491
268b8ede3928 Update the SBSv2 filtering pref options from the Raptor alias query (union of all available build configs from Raptor).
timkelly
parents: 1480
diff changeset
    90
			String[] tok = platform.split(".");
268b8ede3928 Update the SBSv2 filtering pref options from the Raptor alias query (union of all available build configs from Raptor).
timkelly
parents: 1480
diff changeset
    91
			if (tok.length > 0) return tok[0];
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    92
		}
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    93
		return platform;
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    94
	}
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    95
	
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
    96
	public String getPlatformReleaseDirName() {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    97
		return platform;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    98
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    99
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   100
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   101
	public String getTargetString() {
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   102
		if (target == null){
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
   103
			return configQueryData.getConfigurationErrorMessage();
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   104
		}
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   105
		return target;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   106
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   107
1433
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
   108
	public String getConfigID(){
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
   109
		return configID;
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
   110
	}
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
   111
	
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   112
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   113
	public String getDisplayString() {
1438
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   114
		Check.checkState(displayString != null);
1423
17dfd1c1fef1 return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents: 1420
diff changeset
   115
		return displayString;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   116
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   117
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   118
	@Override
1433
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
   119
	public String toString() {
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
   120
		return getConfigID();
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
   121
	}
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
   122
1a693b01d107 1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents: 1425
diff changeset
   123
	@Override
1471
62024a5fa81d Refactor out BSF/SBV support from SBSv2 Builder data. Create new package for SBSv2Query APIs (moved from builder tests).
timkelly
parents: 1462
diff changeset
   124
	public String getDefaultDefFileDirectoryName() {
1479
a654857ddb87 refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents: 1478
diff changeset
   125
	
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   126
		String dirName = getDefFileDirectoryNameForPlatform(platform);
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   127
		
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   128
		if (dirName == null) {
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   129
			// fallback for unknown cases
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   130
			dirName = platform;
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   131
		}
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   132
		
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   133
		return dirName;
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   134
	}
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   135
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   136
	private String getDefFileDirectoryNameForPlatform(String platform) {
1479
a654857ddb87 refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents: 1478
diff changeset
   137
		if (sbsv2Alias.toUpperCase().contains("WINSCW")) {
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   138
			return "BWINS"; //$NON-NLS-1$
1479
a654857ddb87 refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents: 1478
diff changeset
   139
		} else if (sbsv2Alias.toUpperCase().contains("ARM")) {
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   140
			return "EABI"; //$NON-NLS-1$
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   141
		}
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   142
		return null;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   143
	}
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   144
	
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   145
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   146
	public IPath getCompilerPrefixFile() {
1479
a654857ddb87 refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents: 1478
diff changeset
   147
		
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   148
		if (sbsv2Alias.toUpperCase().contains(TOOLCHAIN_GCCE) ||
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   149
			sbsv2Alias.toUpperCase().contains(TOOLCHAIN_ARM)) {
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   150
			if (configQueryData != null) {
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   151
				return new Path(configQueryData.getBuildPrefix());
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   152
			}
1471
62024a5fa81d Refactor out BSF/SBV support from SBSv2 Builder data. Create new package for SBSv2Query APIs (moved from builder tests).
timkelly
parents: 1462
diff changeset
   153
		} 
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   154
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   155
		// fallback for WINSCW, MSVC, etc.
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   156
		return null;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   157
	}
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   158
	
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   159
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   160
	public List<IDefine> getVariantHRHDefines() {
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   161
		return getCachedData().getVariantHRHDefines();
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   162
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   163
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   164
	@Override
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   165
	public List<File> getVariantHRHIncludes() {
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   166
		return getCachedData().getPrefixFileIncludes();
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   167
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   168
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   169
	@Override
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   170
	public List<IDefine> getCompilerPreincludeDefines() {
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   171
		IPath prefixFile = getCompilerPrefixFile();
1662
a3c5489267d1 Check whether compiler prefix file returned by Raptor query really exist when scanning for compiler macros.
stechong
parents: 1644
diff changeset
   172
		if (prefixFile == null || !prefixFile.toFile().exists()) {
1669
d7359f2d2080 Make sure we're getting the correct set of macros for each SBSv2 build context.
stechong
parents: 1662
diff changeset
   173
			return getCachedData().getCompilerMacros(null);
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   174
		}
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   175
		
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   176
		return getCachedData().getCompilerMacros(prefixFile);
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   177
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   178
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   179
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   180
	public String getBuildVariationName() {
1709
6bd6640867aa clean up some TODOs
timkelly
parents: 1691
diff changeset
   181
		// Not needed for Raptor
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   182
		return "";
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   183
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   184
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   185
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   186
	public String getSBSv2Alias() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   187
		return sbsv2Alias;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   188
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   189
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   190
	/**
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   191
	 * Get the cache holding the data that applies to this build context globally.
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   192
	 * A build context is subclassed by CarbideBuildConfiguration, which has multiple
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   193
	 * instances at runtime, thus, a SymbianBuildContext instance should not hold a cache itself.
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   194
	 * @return cache, never <code>null</code>
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   195
	 */
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   196
	private SymbianBuildContextDataCache getCachedData() {
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   197
		return SymbianBuildContextDataCache.getCache(this);
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   198
	}
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   199
	
1419
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   200
	/**
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   201
	 * Get the list of #include paths detected for this context.
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   202
	 * @return List or <code>null</code>
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   203
	 */
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   204
	public List<File> getCachedSystemIncludePaths() {
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   205
		return getCachedData().getSystemIncludePaths();
ab555eecf681 some work to keep SBSv2 alive while refactoring
timkelly
parents: 1418
diff changeset
   206
	}
1420
9dfc6e3dc4b9 more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents: 1419
diff changeset
   207
	
1425
7903a1588fd4 more work to keep SBSv2 and SBSV1 working after refactoring. I think we are back to functional parity as before the refactoring now.
timkelly
parents: 1423
diff changeset
   208
1438
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   209
	public static String getPlatformFromV1ConfigName(String displayString) {
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   210
		String[] tokens = displayString.split(" ");
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   211
		String sdkIdToken = tokens[2];
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   212
		if (sdkIdToken.contains("_")){
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   213
			sdkIdToken = sdkIdToken.substring(1, sdkIdToken.length()-1);
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   214
			String[] aliasTokens = sdkIdToken.split("_");
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   215
			return aliasTokens[0];
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   216
		} else {
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   217
			return sdkIdToken.substring(1, sdkIdToken.length()-1);
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   218
		}
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   219
	}
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   220
1749
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   221
	@Override
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   222
	public int hashCode() {
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   223
		final int prime = 31;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   224
		int result = 1;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   225
		result = prime * result
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   226
				+ ((configID == null) ? 0 : configID.hashCode());
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   227
		return result;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   228
	}
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   229
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   230
	@Override
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   231
	public boolean equals(Object obj) {
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   232
		if (this == obj)
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   233
			return true;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   234
		if (obj == null)
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   235
			return false;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   236
		if (getClass() != obj.getClass())
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   237
			return false;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   238
		BuildContextSBSv2 other = (BuildContextSBSv2) obj;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   239
		if (configID == null) {
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   240
			if (other.configID != null)
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   241
				return false;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   242
		} else if (!configID.equals(other.configID))
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   243
			return false;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   244
		return true;
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   245
	}
0d2e2c9062b1 Simplify APIs around error parser ids/arrays. Clarify some comments in API after review with David.
timkelly
parents: 1739
diff changeset
   246
1438
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   247
	public static String getTargetFromV1ConfigName(String displayString) {
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   248
		String[] tokens = displayString.split(" ");
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   249
		if (tokens[1].compareTo("Debug") == 0) {
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   250
			return ISymbianBuildContext.DEBUG_TARGET;
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   251
		} else {
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   252
			return ISymbianBuildContext.RELEASE_TARGET;
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   253
		}
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   254
	}
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   255
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   256
	public static String getBuildAliasFromV1ConfigName(String displayString) {
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   257
		String target = getTargetFromV1ConfigName(displayString);
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   258
		String platform = getPlatformFromV1ConfigName(displayString);
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   259
		return platform.toLowerCase() + "_" + target.toLowerCase();
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   260
	}
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   261
	
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   262
	// Fall-back to get SDK id from old config name
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   263
	public static String getSDKIDFromV1ConfigName(String configName) {
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   264
		int indexBegin = configName.indexOf("[");  //$NON-NLS-1$
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   265
		int indexEnd = configName.indexOf("]");  //$NON-NLS-1$
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   266
		if (indexBegin > 0 && indexEnd > 0){
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   267
			return configName.substring(indexBegin+1, indexEnd);
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   268
		} else {
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   269
			return ""; //$NON-NLS-1$
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   270
		}
03403c6a4740 Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents: 1437
diff changeset
   271
	}
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   272
	
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
   273
	private void setPlatformAndTargetFromOutputPath() {
1643
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   274
		String pathString = configQueryData.getOutputPathString();
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   275
		if (pathString == null || pathString.length() == 0) {
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   276
			platform = "";
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   277
			target = "";
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   278
			return;
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   279
		}
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   280
		
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
   281
		IPath releasePath = new Path(configQueryData.getOutputPathString());
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   282
		int epoc32SegmentIndex = 0;
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   283
		for (String segment : releasePath.segments()){
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   284
			if (segment.toLowerCase().equals("epoc32"))
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   285
				break;
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   286
			epoc32SegmentIndex++;
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   287
		}
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   288
		// assuming /epoc32/<release>/<target>/
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   289
		platform = releasePath.segment(epoc32SegmentIndex+2).toUpperCase();
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   290
		target = releasePath.segment(epoc32SegmentIndex+3).toUpperCase();
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   291
	}
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   292
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   293
	private ISBSv2ConfigQueryData setConfigQueryData(ISymbianSDK sdk, String alias) {
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   294
		SBSv2ConfigQueryData configQueryData = null;
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   295
		try {
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   296
			configQueryData = SBSv2QueryUtils.getConfigQueryDataForSDK(sdk, alias);
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   297
			if (configQueryData == null) {
1691
b249ba29f642 Remove boolean API to force rescan the SBS cache (there was API to do that already)
timkelly
parents: 1685
diff changeset
   298
				Map<String, String> aliasToMeaningMap = SBSv2QueryUtils.getAliasesForSDK(sdk);
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   299
				List<String> aliasList = new ArrayList<String>();
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   300
				aliasList.add(alias);
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   301
				String configQueryXML = SBSv2QueryUtils.getConfigQueryXMLforSDK(sdk, aliasList);
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   302
				if (aliasToMeaningMap.get(alias) != null){
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   303
					configQueryData = new SBSv2ConfigQueryData(alias, aliasToMeaningMap.get(alias), configQueryXML);
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   304
				}
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   305
			}
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   306
		} catch (final SBSv2MinimumVersionException e) {
1847
5a696c4ef747 more Linux related fixes
timkelly
parents: 1811
diff changeset
   307
			reportedSBSVersionError = true; // only report once per IDE session.
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   308
			PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   309
				public void run() {
1847
5a696c4ef747 more Linux related fixes
timkelly
parents: 1811
diff changeset
   310
					if (!reportedSBSVersionError){
5a696c4ef747 more Linux related fixes
timkelly
parents: 1811
diff changeset
   311
						MessageDialog.openError(WorkbenchUtils.getSafeShell(), "Minimum sbs version not met.", e.getMessage());
5a696c4ef747 more Linux related fixes
timkelly
parents: 1811
diff changeset
   312
					}
1621
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   313
				}
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   314
			});	
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   315
			Logging.log(SDKCorePlugin.getDefault(), Logging.newSimpleStatus(0, IStatus.ERROR,
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   316
						MessageFormat.format(e.getMessage(), ""), e));
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   317
		}
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   318
		
393b985a50f3 Raptor scanner discovery on top of new Raptor Query API.
stechong
parents: 1568
diff changeset
   319
		return configQueryData;
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1471
diff changeset
   320
	}
1420
9dfc6e3dc4b9 more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents: 1419
diff changeset
   321
1643
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   322
	@Override
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
   323
	public ISBSv2ConfigQueryData getConfigQueryData() {
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1521
diff changeset
   324
		return configQueryData;
1521
807590ebabb2 Get SBSv2 macros via Raptor query.
stechong
parents: 1491
diff changeset
   325
	}
1643
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   326
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   327
	@Override
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   328
	public String getToolChain() {
1644
2db4594b310f fix NPEs when SBSv2ConfigQueryData does not exist due to it's EPOCROOT no longer existing (e.g. removing the subst)
timkelly
parents: 1643
diff changeset
   329
		
2db4594b310f fix NPEs when SBSv2ConfigQueryData does not exist due to it's EPOCROOT no longer existing (e.g. removing the subst)
timkelly
parents: 1643
diff changeset
   330
		if (configQueryData != null) {
2db4594b310f fix NPEs when SBSv2ConfigQueryData does not exist due to it's EPOCROOT no longer existing (e.g. removing the subst)
timkelly
parents: 1643
diff changeset
   331
			Map<String, String> buildMacros = configQueryData.getBuildMacros();
1643
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   332
			// try to figure out the tool chain using macros from Raptor config query
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   333
			if (buildMacros.containsKey(MACRO_ARM)) {
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   334
				return TOOLCHAIN_ARM;
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   335
			} else if (buildMacros.containsKey(MACRO_GCCE)) {
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   336
				return TOOLCHAIN_GCCE;
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   337
			} else if (buildMacros.containsKey(MACRO_WINSCW)) {
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   338
				return TOOLCHAIN_WINSCW;
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   339
			}
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   340
		} else {
1644
2db4594b310f fix NPEs when SBSv2ConfigQueryData does not exist due to it's EPOCROOT no longer existing (e.g. removing the subst)
timkelly
parents: 1643
diff changeset
   341
			// if no macros available, use alias name instead
1643
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   342
			if (sbsv2Alias.toUpperCase().contains(TOOLCHAIN_ARM)) {
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   343
				return TOOLCHAIN_ARM;
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   344
			} else if (sbsv2Alias.toUpperCase().contains(TOOLCHAIN_GCCE)) {
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   345
				return TOOLCHAIN_GCCE;
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   346
			} else if (sbsv2Alias.toUpperCase().contains(TOOLCHAIN_WINSCW)) {
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   347
				return TOOLCHAIN_WINSCW;
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   348
			}
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   349
		}
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   350
		return TOOLCHAIN_UNKNOWN;
3fb715ff2227 Set error parser IDs based on compiler macros from Raptor config query.
stechong
parents: 1621
diff changeset
   351
	}
1678
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   352
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   353
	@Override
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   354
	public List<IPath> getSystemIncludes() {
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   355
		if (configQueryData != null) {
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   356
			List<String> includes = configQueryData.getMetaDataIncludes();
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   357
			if (includes != null && !includes.isEmpty()) {
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   358
				List<IPath> includePaths = new ArrayList<IPath>();
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   359
				for (Iterator<String> itr = includes.iterator(); itr.hasNext();) {
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   360
					String include = itr.next();
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   361
					if (include.length() == 0 || include.equals(".")) {
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   362
						continue;
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   363
					}
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   364
					Path includePath = new Path(include);
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   365
					if (!includePaths.contains(includePath)) {
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   366
						includePaths.add(includePath);
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   367
					}
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   368
				}
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   369
				return includePaths;
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   370
			}
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   371
		}
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   372
		return null;
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   373
	}
75bd74aedcb6 Make use of system include paths returned by Raptor config query.
stechong
parents: 1669
diff changeset
   374
1736
ba74c19c6de3 fix bug 11762. Fix targettypes for MMP editor to retrieve properly depending on whether build config is SBsv1 or SBSv2.
timkelly
parents: 1709
diff changeset
   375
	@Override
ba74c19c6de3 fix bug 11762. Fix targettypes for MMP editor to retrieve properly depending on whether build config is SBsv1 or SBSv2.
timkelly
parents: 1709
diff changeset
   376
	public List<String> getSupportedTargettypes() {
ba74c19c6de3 fix bug 11762. Fix targettypes for MMP editor to retrieve properly depending on whether build config is SBsv1 or SBSv2.
timkelly
parents: 1709
diff changeset
   377
		return configQueryData.getTargettypes();
ba74c19c6de3 fix bug 11762. Fix targettypes for MMP editor to retrieve properly depending on whether build config is SBsv1 or SBSv2.
timkelly
parents: 1709
diff changeset
   378
	}
ba74c19c6de3 fix bug 11762. Fix targettypes for MMP editor to retrieve properly depending on whether build config is SBsv1 or SBSv2.
timkelly
parents: 1709
diff changeset
   379
1755
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1749
diff changeset
   380
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1749
diff changeset
   381
	@Override
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1749
diff changeset
   382
	public void loadConfigurationSettings(ICStorageElement se) {
1764
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   383
		if (sbsv2BuildInfo == null){
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   384
			sbsv2BuildInfo = new SBSv2BuilderInfo();
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   385
		}
1755
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1749
diff changeset
   386
		
1764
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   387
		sbsv2BuildInfo.loadFromStorage(se);
1755
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1749
diff changeset
   388
	}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1749
diff changeset
   389
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1749
diff changeset
   390
	@Override
1764
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   391
	public void saveConfigurationSettings(ICStorageElement se, ISymbianBuildContext context) {
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   392
		sbsv2BuildInfo = new SBSv2BuilderInfo((ISBSv2BuildContext)context);
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   393
		sbsv2BuildInfo.saveToStorage(se.createChild(SBSV2_DATA_ID)); 
1755
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1749
diff changeset
   394
	}
1770
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   395
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   396
	@Override
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   397
	/**
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   398
	 * Get the unique ID for this build configuration.
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   399
	 * For ABLD it is the display name, for SBSv2, it is the builder ID (cconfiguration 'id')
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   400
	 * @return
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   401
	 */
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   402
	public String getConfigurationID() {
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   403
		return getConfigID();
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   404
	}
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   405
	
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   406
	/**
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   407
	 * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   408
	 * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   409
	 */
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   410
	public IPath getPrefixFromVariantCfg(){
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   411
		ISBSv2BuildInfo sbsv2BldInfo = ((ISBSv2BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER));
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   412
		return sbsv2BldInfo.getPrefixFromVariantCfg();
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   413
	}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1770
diff changeset
   414
1804
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1801
diff changeset
   415
	@Override
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1801
diff changeset
   416
	public List<IDefine> getBuildMacros() {
1811
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   417
		ISBSv2BuildInfo sbsv2BldInfo = ((ISBSv2BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER));
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   418
		Map<String, String> buildMacroMap = sbsv2BldInfo.getBuildMacros(getSBSv2Alias());
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   419
		List<IDefine> defines = new ArrayList<IDefine>();
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   420
		for (String macroName : buildMacroMap.keySet()){
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   421
			defines.add(DefineFactory.createDefine(macroName, buildMacroMap.get(macroName)));
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   422
		}
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   423
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   424
		return defines;
1804
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1801
diff changeset
   425
	}
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1801
diff changeset
   426
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1801
diff changeset
   427
	@Override
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1801
diff changeset
   428
	public List<IDefine> getMetadataMacros() {
1811
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   429
		ISBSv2BuildInfo sbsv2BldInfo = ((ISBSv2BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER));
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   430
		Map<String, String> platMacroMap = sbsv2BldInfo.getMetadataMacros(getSBSv2Alias());
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   431
		List<IDefine> defines = new ArrayList<IDefine>();
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   432
		for (String macroName : platMacroMap.keySet()){
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   433
			defines.add(DefineFactory.createDefine(macroName, platMacroMap.get(macroName)));
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   434
		}
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   435
		
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   436
		return defines;
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   437
	}
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   438
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   439
	@Override
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   440
	public IDefine getTargetTypeMacro(String targettype) {
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   441
		ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   442
		return DefineFactory.createDefine(sbsv2BuildInfo.getTargetTypeMacro(targettype));
1804
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1801
diff changeset
   443
	}
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1801
diff changeset
   444
1770
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   445
1764
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   446
	
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   447
}