author | timkelly |
Wed, 02 Jun 2010 16:06:56 -0500 | |
branch | C3_BUILDER_WORK |
changeset 1420 | 9dfc6e3dc4b9 |
parent 1419 | ab555eecf681 |
child 1423 | 17dfd1c1fef1 |
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; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
18 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
19 |
public class BuildContextSBSv2 implements ISBSv2BuildContext { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
20 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
21 |
private String platform; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
22 |
private String target; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
23 |
private String sbsv2Alias; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
24 |
ISymbianSDK sdk; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
25 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
26 |
public BuildContextSBSv2(ISymbianSDK theSDK, String thePlatform, String theTarget, String theSBSv2Alias) { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
27 |
sdk = theSDK; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
28 |
platform = thePlatform.toUpperCase(); |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
29 |
target = theTarget.toUpperCase(); |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
30 |
sbsv2Alias = theSBSv2Alias; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
31 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
32 |
getDisplayString(); |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
33 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
34 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
35 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
36 |
public ISymbianSDK getSDK() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
37 |
return sdk; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
38 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
39 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
40 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
41 |
public String getPlatformString() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
42 |
return platform; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
43 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
44 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
45 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
46 |
public String getTargetString() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
47 |
return target; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
48 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
49 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
50 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
51 |
public String getDisplayString() { |
1419 | 52 |
// TODO We will need to cobble up proper display names |
53 |
return "(" + sbsv2Alias + ") " + "[" + sdk.getUniqueId() + "]" ; |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
54 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
55 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
56 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
57 |
public String getDefaultDefFileDirectoryName(boolean isASSP) { |
1419 | 58 |
// TOOD: THIS IS ABLD STUFF. isASSP does not belong with Raptor |
59 |
// TODO: How the ASSP option affects the path? |
|
60 |
||
61 |
String dirName = getDefFileDirectoryNameForPlatform(platform); |
|
62 |
if (dirName == null) { |
|
63 |
// check BSF's |
|
64 |
IBSFCatalog catalog = getSDK().getBSFCatalog(); |
|
65 |
if (catalog != null) { |
|
66 |
for (IBSFPlatform plat : catalog.getPlatforms()) { |
|
67 |
if (plat.getName().compareToIgnoreCase(platform) == 0) { |
|
68 |
String mainPlatform = catalog.getReleasePlatform(platform); |
|
69 |
if (mainPlatform != null) { |
|
70 |
dirName = getDefFileDirectoryNameForPlatform(mainPlatform); |
|
71 |
if (dirName == null || dirName.length() < 1) { |
|
72 |
// fallback - all BSF's should be EABI anyway |
|
73 |
return "EABI"; //$NON-NLS-1$ |
|
74 |
} |
|
75 |
} |
|
76 |
} |
|
77 |
} |
|
78 |
} |
|
79 |
} |
|
80 |
||
81 |
if (dirName == null) { |
|
82 |
// fallback for unknown cases |
|
83 |
dirName = platform; |
|
84 |
} |
|
85 |
||
86 |
return dirName; |
|
87 |
} |
|
88 |
||
89 |
private String getDefFileDirectoryNameForPlatform(String platform) { |
|
90 |
// TODO: This is still ABLD stype stuff |
|
91 |
if (platform.equals(EMULATOR_PLATFORM)) { |
|
92 |
return "BWINS"; //$NON-NLS-1$ |
|
93 |
} else if (platform.equals(ARMV5_PLATFORM) |
|
94 |
|| platform.equals(ARMV5_ABIV2_PLATFORM) |
|
95 |
|| platform.equals(ARMV6_PLATFORM) |
|
96 |
|| platform.equals(ARMV6_ABIV2_PLATFORM) |
|
97 |
|| platform.equals(GCCE_PLATFORM)) { |
|
98 |
return "EABI"; //$NON-NLS-1$ |
|
99 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
100 |
return null; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
101 |
} |
1419 | 102 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
103 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
104 |
public IPath getCompilerPrefixFile() { |
1419 | 105 |
// TODO: This is ABLD hard-code mechanism. Should be able to get from Raptor query mechanism |
106 |
if (platform.equals(GCCE_PLATFORM)) { |
|
107 |
return getGCCEPrefixFilePath(); |
|
108 |
} else if (platform.equals(ARMV5_PLATFORM) |
|
109 |
|| platform.equals(ARMV5_ABIV2_PLATFORM) |
|
110 |
|| platform.equals(ARMV6_PLATFORM) |
|
111 |
|| platform.equals(ARMV6_ABIV2_PLATFORM)) { |
|
112 |
return getRVCTPrefixFilePath(); |
|
113 |
} else { |
|
114 |
// check BSF's |
|
115 |
IBSFCatalog catalog = getSDK().getBSFCatalog(); |
|
116 |
if (catalog != null) { |
|
117 |
for (IBSFPlatform plat : catalog.getPlatforms()) { |
|
118 |
if (plat.getName().compareToIgnoreCase(platform) == 0) { |
|
119 |
String mainPlatform = catalog.getReleasePlatform(platform); |
|
120 |
if (mainPlatform != null) { |
|
121 |
if (mainPlatform.equals(GCCE_PLATFORM)) { |
|
122 |
return getGCCEPrefixFilePath(); |
|
123 |
} else if (mainPlatform.equals(ARMV5_PLATFORM) |
|
124 |
|| mainPlatform.equals(ARMV5_ABIV2_PLATFORM) |
|
125 |
|| mainPlatform.equals(ARMV6_PLATFORM) |
|
126 |
|| mainPlatform.equals(ARMV6_ABIV2_PLATFORM)) { |
|
127 |
return getRVCTPrefixFilePath(); |
|
128 |
} else { |
|
129 |
// fallback - all BSF's should be EABI anyway |
|
130 |
return getRVCTPrefixFilePath(); |
|
131 |
} |
|
132 |
} |
|
133 |
} |
|
134 |
} |
|
135 |
} |
|
136 |
} |
|
137 |
||
138 |
// fallback for WINSCW, MSVC, etc. |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
139 |
return null; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
140 |
} |
1419 | 141 |
|
142 |
private IPath getGCCEPrefixFilePath() { |
|
143 |
// TOOD: Should get from Raptor query when available |
|
144 |
return getSDK().getIncludePath().append("gcce/gcce.h"); //$NON-NLS-1$ |
|
145 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
146 |
|
1419 | 147 |
private IPath getRVCTPrefixFilePath() { |
148 |
// TODO: Should get this from query mechanism |
|
149 |
IRVCTToolChainInfo[] installedRVCTTools = SDKCorePlugin.getSDKManager().getInstalledRVCTTools(); |
|
150 |
// use default in case tools aren't installed |
|
151 |
String rvctFragment = "rvct2_2"; //$NON-NLS-1$ |
|
152 |
if (installedRVCTTools.length > 0) { |
|
153 |
rvctFragment = getRVCTFragment(installedRVCTTools[0]); |
|
154 |
} |
|
155 |
IPath prefixFilePath = getSDK().getIncludePath().append(rvctFragment).append(rvctFragment + ".h"); //$NON-NLS-1$ |
|
156 |
if (prefixFilePath.toFile().exists()){ |
|
157 |
return prefixFilePath; |
|
158 |
} else { |
|
159 |
// SF kits around SF^3 started to only use a single rvct.h header instead of specific versioned ones |
|
160 |
// based on the default installation |
|
161 |
return getSDK().getIncludePath().append("rvct").append("rvct" + ".h"); |
|
162 |
} |
|
163 |
} |
|
164 |
||
165 |
private String getRVCTFragment(IRVCTToolChainInfo info) { |
|
166 |
// TODO: This should not be needed when raptor query is complete |
|
167 |
int major = 0, minor = 0; |
|
168 |
if (info != null) { |
|
169 |
Version rvctToolsVersion = info.getRvctToolsVersion(); |
|
170 |
if (rvctToolsVersion != null) { |
|
171 |
major = info.getRvctToolsVersion().getMajor(); |
|
172 |
minor = info.getRvctToolsVersion().getMinor(); |
|
173 |
} |
|
174 |
} |
|
175 |
return "rvct" + major + "_" + minor; //$NON-NLS-1$ //$NON-NLS-2$ |
|
176 |
} |
|
177 |
||
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
178 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
179 |
public List<IDefine> getVariantHRHDefines() { |
1419 | 180 |
// TODO: Should get from raptor query |
181 |
return getCachedData().getVariantHRHDefines(); |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
182 |
} |
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 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
185 |
public List<File> getPrefixFileIncludes() { |
1419 | 186 |
// TODO: Should get from raptor query |
187 |
return getCachedData().getPrefixFileIncludes(); |
|
1418
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 |
|
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> getCompilerMacros() { |
1419 | 192 |
// TODO: Should get from raptor query |
193 |
// we parse the compiler prefix file to gather macros. this can be time consuming so do it |
|
194 |
// once and cache the values. only reset the cache when the compiler prefix has changed. |
|
195 |
||
196 |
IPath prefixFile = getCompilerPrefixFile(); |
|
197 |
if (prefixFile == null) { |
|
198 |
return Collections.emptyList(); |
|
199 |
} |
|
200 |
||
201 |
return getCachedData().getCompilerMacros(prefixFile); |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
202 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
203 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
204 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
205 |
public String getBuildVariationName() { |
1419 | 206 |
// TODO: This should not be needed for Raptor |
207 |
return ""; |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
208 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
209 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
210 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
211 |
public boolean isSymbianBinaryVariation() { |
1419 | 212 |
// This should not be needed for Raptor. We do need a check |
213 |
// in the MPP for the featurevariant keyword perhaps |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
214 |
return false; |
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 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
217 |
/** |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
218 |
* 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
|
219 |
* @param displayName |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
220 |
* @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
|
221 |
*/ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
222 |
private static String getSBSv2AliasFromConfigName(String displayName) { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
223 |
int indexBegin = displayName.indexOf("("); //$NON-NLS-1$ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
224 |
int indexEnd = displayName.indexOf(")"); //$NON-NLS-1$ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
225 |
if (indexBegin > 0 && indexEnd > 0){ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
226 |
String configPart = displayName.substring(indexBegin+1, indexEnd); |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
227 |
if (configPart.split("_").length > 1){ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
228 |
return configPart; |
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 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
231 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
232 |
return null; |
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 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
235 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
236 |
public String getSBSv2Alias() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
237 |
return sbsv2Alias; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
238 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
239 |
|
1419 | 240 |
/** |
241 |
* Get the cache holding the data that applies to this build context globally. |
|
242 |
* A build context is subclassed by CarbideBuildConfiguration, which has multiple |
|
243 |
* instances at runtime, thus, a SymbianBuildContext instance should not hold a cache itself. |
|
244 |
* @return cache, never <code>null</code> |
|
245 |
*/ |
|
246 |
private SymbianBuildContextDataCache getCachedData() { |
|
247 |
// TODO: Still need to consider this for SBSv2 refactoring / Raptor query |
|
248 |
return SymbianBuildContextDataCache.getCache(this); |
|
249 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
250 |
|
1419 | 251 |
/** |
252 |
* Get the list of #include paths detected for this context. |
|
253 |
* @return List or <code>null</code> |
|
254 |
*/ |
|
255 |
public List<File> getCachedSystemIncludePaths() { |
|
256 |
// TODO: Still need to consider this for SBSv2 refactoring / Raptor query |
|
257 |
return getCachedData().getSystemIncludePaths(); |
|
258 |
} |
|
1420
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
259 |
|
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
260 |
|
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
261 |
// Fall-back to get SDK id from old config name |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
262 |
public static String getSDKIDFromConfigName(String configName) { |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
263 |
int indexBegin = configName.indexOf("["); //$NON-NLS-1$ |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
264 |
int indexEnd = configName.indexOf("]"); //$NON-NLS-1$ |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
265 |
if (indexBegin > 0 && indexEnd > 0){ |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
266 |
return configName.substring(indexBegin+1, indexEnd); |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
267 |
} else { |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
268 |
return ""; //$NON-NLS-1$ |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
269 |
} |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
270 |
} |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
271 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
272 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
273 |
} |