author | timkelly |
Tue, 08 Jun 2010 10:24:12 -0500 | |
branch | C3_BUILDER_WORK |
changeset 1438 | 03403c6a4740 |
parent 1437 | 8534c28043b9 |
child 1439 | 8266d8737e89 |
permissions | -rw-r--r-- |
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; |
1419 | 4 |
import java.util.Collections; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
5 |
import java.util.List; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
6 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
7 |
import org.eclipse.core.runtime.IPath; |
1419 | 8 |
import org.osgi.framework.Version; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
9 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
10 |
import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; |
1419 | 11 |
import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; |
12 |
import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; |
|
13 |
import com.nokia.carbide.cpp.sdk.core.IRVCTToolChainInfo; |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
14 |
import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext; |
1420
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
15 |
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
16 |
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; |
1419 | 17 |
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
|
18 |
import com.nokia.cpp.internal.api.utils.core.Check; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
19 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
20 |
public class BuildContextSBSv2 implements ISBSv2BuildContext { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
21 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
22 |
private String platform; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
23 |
private String target; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
24 |
private String sbsv2Alias; |
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
25 |
private ISymbianSDK sdk; |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
26 |
private String displayString; |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
27 |
private String configID; // cconfiguration 'id' attribute from .cproject |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
28 |
|
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
29 |
public BuildContextSBSv2(ISymbianSDK theSDK, String thePlatform, String theTarget, String theSBSv2Alias, String displayName, String configID) { |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
30 |
this.sdk = theSDK; |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
31 |
this.platform = thePlatform.toUpperCase(); |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
32 |
this.target = theTarget.toUpperCase(); |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
33 |
this.sbsv2Alias = theSBSv2Alias; |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
34 |
this.displayString = displayName; |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
35 |
this.configID = configID; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
36 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
37 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
38 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
39 |
public ISymbianSDK getSDK() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
40 |
return sdk; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
41 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
42 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
43 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
44 |
public String getPlatformString() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
45 |
return platform; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
46 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
47 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
48 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
49 |
public String getTargetString() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
50 |
return target; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
51 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
52 |
|
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
53 |
public String getConfigID(){ |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
54 |
return configID; |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
55 |
} |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
56 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
57 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
58 |
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
|
59 |
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
|
60 |
return displayString; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
61 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
62 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
63 |
@Override |
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
64 |
public String toString() { |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
65 |
return getConfigID(); |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
66 |
} |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
67 |
|
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
68 |
@Override |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
69 |
public String getDefaultDefFileDirectoryName(boolean isASSP) { |
1419 | 70 |
// TOOD: THIS IS ABLD STUFF. isASSP does not belong with Raptor |
71 |
// TODO: How the ASSP option affects the path? |
|
72 |
||
73 |
String dirName = getDefFileDirectoryNameForPlatform(platform); |
|
74 |
if (dirName == null) { |
|
75 |
// check BSF's |
|
76 |
IBSFCatalog catalog = getSDK().getBSFCatalog(); |
|
77 |
if (catalog != null) { |
|
78 |
for (IBSFPlatform plat : catalog.getPlatforms()) { |
|
79 |
if (plat.getName().compareToIgnoreCase(platform) == 0) { |
|
80 |
String mainPlatform = catalog.getReleasePlatform(platform); |
|
81 |
if (mainPlatform != null) { |
|
82 |
dirName = getDefFileDirectoryNameForPlatform(mainPlatform); |
|
83 |
if (dirName == null || dirName.length() < 1) { |
|
84 |
// fallback - all BSF's should be EABI anyway |
|
85 |
return "EABI"; //$NON-NLS-1$ |
|
86 |
} |
|
87 |
} |
|
88 |
} |
|
89 |
} |
|
90 |
} |
|
91 |
} |
|
92 |
||
93 |
if (dirName == null) { |
|
94 |
// fallback for unknown cases |
|
95 |
dirName = platform; |
|
96 |
} |
|
97 |
||
98 |
return dirName; |
|
99 |
} |
|
100 |
||
101 |
private String getDefFileDirectoryNameForPlatform(String platform) { |
|
102 |
// TODO: This is still ABLD stype stuff |
|
103 |
if (platform.equals(EMULATOR_PLATFORM)) { |
|
104 |
return "BWINS"; //$NON-NLS-1$ |
|
105 |
} else if (platform.equals(ARMV5_PLATFORM) |
|
106 |
|| platform.equals(ARMV5_ABIV2_PLATFORM) |
|
107 |
|| platform.equals(ARMV6_PLATFORM) |
|
108 |
|| platform.equals(ARMV6_ABIV2_PLATFORM) |
|
109 |
|| platform.equals(GCCE_PLATFORM)) { |
|
110 |
return "EABI"; //$NON-NLS-1$ |
|
111 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
112 |
return null; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
113 |
} |
1419 | 114 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
115 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
116 |
public IPath getCompilerPrefixFile() { |
1419 | 117 |
// TODO: This is ABLD hard-code mechanism. Should be able to get from Raptor query mechanism |
118 |
if (platform.equals(GCCE_PLATFORM)) { |
|
119 |
return getGCCEPrefixFilePath(); |
|
120 |
} else if (platform.equals(ARMV5_PLATFORM) |
|
121 |
|| platform.equals(ARMV5_ABIV2_PLATFORM) |
|
122 |
|| platform.equals(ARMV6_PLATFORM) |
|
123 |
|| platform.equals(ARMV6_ABIV2_PLATFORM)) { |
|
124 |
return getRVCTPrefixFilePath(); |
|
125 |
} else { |
|
126 |
// check BSF's |
|
127 |
IBSFCatalog catalog = getSDK().getBSFCatalog(); |
|
128 |
if (catalog != null) { |
|
129 |
for (IBSFPlatform plat : catalog.getPlatforms()) { |
|
130 |
if (plat.getName().compareToIgnoreCase(platform) == 0) { |
|
131 |
String mainPlatform = catalog.getReleasePlatform(platform); |
|
132 |
if (mainPlatform != null) { |
|
133 |
if (mainPlatform.equals(GCCE_PLATFORM)) { |
|
134 |
return getGCCEPrefixFilePath(); |
|
135 |
} else if (mainPlatform.equals(ARMV5_PLATFORM) |
|
136 |
|| mainPlatform.equals(ARMV5_ABIV2_PLATFORM) |
|
137 |
|| mainPlatform.equals(ARMV6_PLATFORM) |
|
138 |
|| mainPlatform.equals(ARMV6_ABIV2_PLATFORM)) { |
|
139 |
return getRVCTPrefixFilePath(); |
|
140 |
} else { |
|
141 |
// fallback - all BSF's should be EABI anyway |
|
142 |
return getRVCTPrefixFilePath(); |
|
143 |
} |
|
144 |
} |
|
145 |
} |
|
146 |
} |
|
147 |
} |
|
148 |
} |
|
149 |
||
150 |
// fallback for WINSCW, MSVC, etc. |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
151 |
return null; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
152 |
} |
1419 | 153 |
|
154 |
private IPath getGCCEPrefixFilePath() { |
|
155 |
// TOOD: Should get from Raptor query when available |
|
156 |
return getSDK().getIncludePath().append("gcce/gcce.h"); //$NON-NLS-1$ |
|
157 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
158 |
|
1419 | 159 |
private IPath getRVCTPrefixFilePath() { |
160 |
// TODO: Should get this from query mechanism |
|
161 |
IRVCTToolChainInfo[] installedRVCTTools = SDKCorePlugin.getSDKManager().getInstalledRVCTTools(); |
|
162 |
// use default in case tools aren't installed |
|
163 |
String rvctFragment = "rvct2_2"; //$NON-NLS-1$ |
|
164 |
if (installedRVCTTools.length > 0) { |
|
165 |
rvctFragment = getRVCTFragment(installedRVCTTools[0]); |
|
166 |
} |
|
167 |
IPath prefixFilePath = getSDK().getIncludePath().append(rvctFragment).append(rvctFragment + ".h"); //$NON-NLS-1$ |
|
168 |
if (prefixFilePath.toFile().exists()){ |
|
169 |
return prefixFilePath; |
|
170 |
} else { |
|
171 |
// SF kits around SF^3 started to only use a single rvct.h header instead of specific versioned ones |
|
172 |
// based on the default installation |
|
173 |
return getSDK().getIncludePath().append("rvct").append("rvct" + ".h"); |
|
174 |
} |
|
175 |
} |
|
176 |
||
177 |
private String getRVCTFragment(IRVCTToolChainInfo info) { |
|
178 |
// TODO: This should not be needed when raptor query is complete |
|
179 |
int major = 0, minor = 0; |
|
180 |
if (info != null) { |
|
181 |
Version rvctToolsVersion = info.getRvctToolsVersion(); |
|
182 |
if (rvctToolsVersion != null) { |
|
183 |
major = info.getRvctToolsVersion().getMajor(); |
|
184 |
minor = info.getRvctToolsVersion().getMinor(); |
|
185 |
} |
|
186 |
} |
|
187 |
return "rvct" + major + "_" + minor; //$NON-NLS-1$ //$NON-NLS-2$ |
|
188 |
} |
|
189 |
||
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
190 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
191 |
public List<IDefine> getVariantHRHDefines() { |
1419 | 192 |
// TODO: Should get from raptor query |
193 |
return getCachedData().getVariantHRHDefines(); |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
194 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
195 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
196 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
197 |
public List<File> getPrefixFileIncludes() { |
1419 | 198 |
// TODO: Should get from raptor query |
199 |
return getCachedData().getPrefixFileIncludes(); |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
200 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
201 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
202 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
203 |
public List<IDefine> getCompilerMacros() { |
1419 | 204 |
// TODO: Should get from raptor query |
205 |
// we parse the compiler prefix file to gather macros. this can be time consuming so do it |
|
206 |
// once and cache the values. only reset the cache when the compiler prefix has changed. |
|
207 |
||
208 |
IPath prefixFile = getCompilerPrefixFile(); |
|
209 |
if (prefixFile == null) { |
|
210 |
return Collections.emptyList(); |
|
211 |
} |
|
212 |
||
213 |
return getCachedData().getCompilerMacros(prefixFile); |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
214 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
215 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
216 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
217 |
public String getBuildVariationName() { |
1419 | 218 |
// TODO: This should not be needed for Raptor |
219 |
return ""; |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
220 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
221 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
222 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
223 |
public boolean isSymbianBinaryVariation() { |
1419 | 224 |
// This should not be needed for Raptor. We do need a check |
225 |
// in the MPP for the featurevariant keyword perhaps |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
226 |
return false; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
227 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
228 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
229 |
/** |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
230 |
* See if the build configuration is an SBSv2 alias, and if so get the build-able alias name |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
231 |
* @param displayName |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
232 |
* @return The full SBSv2 alias that can be used with -c, otherwise null if not SBSv2 |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
233 |
*/ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
234 |
private static String getSBSv2AliasFromConfigName(String displayName) { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
235 |
int indexBegin = displayName.indexOf("("); //$NON-NLS-1$ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
236 |
int indexEnd = displayName.indexOf(")"); //$NON-NLS-1$ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
237 |
if (indexBegin > 0 && indexEnd > 0){ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
238 |
String configPart = displayName.substring(indexBegin+1, indexEnd); |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
239 |
if (configPart.split("_").length > 1){ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
240 |
return configPart; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
241 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
242 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
243 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
244 |
return null; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
245 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
246 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
247 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
248 |
public String getSBSv2Alias() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
249 |
return sbsv2Alias; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
250 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
251 |
|
1419 | 252 |
/** |
253 |
* Get the cache holding the data that applies to this build context globally. |
|
254 |
* A build context is subclassed by CarbideBuildConfiguration, which has multiple |
|
255 |
* instances at runtime, thus, a SymbianBuildContext instance should not hold a cache itself. |
|
256 |
* @return cache, never <code>null</code> |
|
257 |
*/ |
|
258 |
private SymbianBuildContextDataCache getCachedData() { |
|
259 |
// TODO: Still need to consider this for SBSv2 refactoring / Raptor query |
|
260 |
return SymbianBuildContextDataCache.getCache(this); |
|
261 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
262 |
|
1419 | 263 |
/** |
264 |
* Get the list of #include paths detected for this context. |
|
265 |
* @return List or <code>null</code> |
|
266 |
*/ |
|
267 |
public List<File> getCachedSystemIncludePaths() { |
|
268 |
// TODO: Still need to consider this for SBSv2 refactoring / Raptor query |
|
269 |
return getCachedData().getSystemIncludePaths(); |
|
270 |
} |
|
1420
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
271 |
|
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
|
272 |
@Override |
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
|
273 |
public int hashCode() { |
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
|
274 |
final int prime = 31; |
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
|
275 |
int result = 1; |
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
|
276 |
result = prime * result |
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
|
277 |
+ ((platform == null) ? 0 : platform.hashCode()); |
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
|
278 |
result = prime * result + ((getSDK() == null) ? 0 : getSDK().getEPOCROOT().hashCode()); |
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
|
279 |
result = prime * result + ((target == null) ? 0 : target.hashCode()); |
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
|
280 |
return result; |
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
|
281 |
} |
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
|
282 |
|
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
|
283 |
|
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
|
284 |
@Override |
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
|
285 |
public boolean equals(Object obj) { |
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
|
286 |
if (this == obj) |
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
|
287 |
return true; |
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
|
288 |
if (obj == null) |
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
|
289 |
return false; |
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
|
290 |
if (!(obj instanceof BuildContextSBSv2)) |
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
|
291 |
return false; |
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
|
292 |
final BuildContextSBSv2 other = (BuildContextSBSv2) obj; |
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
|
293 |
if (sbsv2Alias == null) { |
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
|
294 |
if (other.sbsv2Alias != null) |
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
|
295 |
return false; |
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
|
296 |
} else if (!sbsv2Alias.equals(other.sbsv2Alias)) |
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
|
297 |
return false; |
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
|
298 |
if (getSDK() == null) { |
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
|
299 |
if (other.getSDK() != null) |
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
|
300 |
return false; |
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
|
301 |
} else if (!getSDK().getEPOCROOT().equals(other.getSDK().getEPOCROOT())) |
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
|
302 |
return false; |
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
|
303 |
if (target == null) { |
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
|
304 |
if (other.target != null) |
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
|
305 |
return false; |
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
|
306 |
} else if (!target.equals(other.target)) { |
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
|
307 |
return false; |
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
308 |
} else if (!configID.equals(other.configID)){ |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
309 |
// TODO: Do we really need anything other than a config ID comparison? |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
310 |
return false; |
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
|
311 |
} |
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
|
312 |
return true; |
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
|
313 |
} |
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
|
314 |
|
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
|
315 |
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
|
316 |
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
|
317 |
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
|
318 |
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
|
319 |
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
|
320 |
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
|
321 |
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
|
322 |
} 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
|
323 |
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
|
324 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
325 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
326 |
|
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
327 |
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
|
328 |
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
|
329 |
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
|
330 |
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
|
331 |
} 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
|
332 |
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
|
333 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
334 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
335 |
|
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
336 |
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
|
337 |
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
|
338 |
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
|
339 |
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
|
340 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
341 |
|
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
342 |
// 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
|
343 |
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
|
344 |
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
|
345 |
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
|
346 |
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
|
347 |
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
|
348 |
} 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
|
349 |
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
|
350 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
351 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
352 |
|
1420
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
353 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
354 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
355 |
} |