author | timkelly |
Thu, 03 Jun 2010 09:58:29 -0500 | |
branch | C3_BUILDER_WORK |
changeset 1425 | 7903a1588fd4 |
parent 1423 | 17dfd1c1fef1 |
child 1433 | 1a693b01d107 |
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 |
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
|
53 |
//return "(" + sbsv2Alias + ") " + "[" + sdk.getUniqueId() + "]" ; |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
54 |
|
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
55 |
// TODO: This is temporary to support the old configs where |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
56 |
// The display name and id were the same thing. Need to work on supporting both |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
57 |
// as we migrate the display name to the settings and use a truly unique ID for configs. |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
58 |
|
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
59 |
String EMULATOR_DISPLAY_TEXT = "Emulator"; //$NON-NLS-1$ |
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 |
String PHONE_DISPLAY_TEXT = "Phone"; //$NON-NLS-1$ |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
61 |
String DEBUG_DISPLAY_TEXT = "Debug"; //$NON-NLS-1$ |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
62 |
String RELEASE_DISPLAY_TEXT = "Release"; //$NON-NLS-1$ |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
63 |
String SPACE_DISPLAY_TEXT = " "; //$NON-NLS-1$ |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
64 |
String SDK_NOT_INSTALLED = "SDK not installed"; //$NON-NLS-1$ |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
65 |
String displayString = null; |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
66 |
if (displayString == null) { |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
67 |
// in the form Emulation Debug (WINSCW) [S60_3rd_MR] or |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
68 |
// Phone Release (GCCE) [S60_3rd_MR] |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
69 |
if (platform.compareTo(ISymbianBuildContext.EMULATOR_PLATFORM) == 0) { |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
70 |
displayString = EMULATOR_DISPLAY_TEXT; |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
71 |
} else { |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
72 |
displayString = PHONE_DISPLAY_TEXT; |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
73 |
} |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
74 |
|
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
75 |
if (target.compareTo(ISymbianBuildContext.DEBUG_TARGET) == 0) { |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
76 |
displayString = displayString + SPACE_DISPLAY_TEXT + DEBUG_DISPLAY_TEXT; |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
77 |
} else { |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
78 |
displayString = displayString + SPACE_DISPLAY_TEXT + RELEASE_DISPLAY_TEXT; |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
79 |
} |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
80 |
|
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
81 |
String basePlatform = sbsv2Alias; |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
82 |
|
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
83 |
displayString = displayString + " (" + basePlatform + ") [" + getSDK().getUniqueId() + "]"; //$NON-NLS-1$ |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
84 |
} |
17dfd1c1fef1
return proper display name for SBSv2 configs until we start using project .cproject data to store config names
timkelly
parents:
1420
diff
changeset
|
85 |
return displayString; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
86 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
87 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
88 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
89 |
public String getDefaultDefFileDirectoryName(boolean isASSP) { |
1419 | 90 |
// TOOD: THIS IS ABLD STUFF. isASSP does not belong with Raptor |
91 |
// TODO: How the ASSP option affects the path? |
|
92 |
||
93 |
String dirName = getDefFileDirectoryNameForPlatform(platform); |
|
94 |
if (dirName == null) { |
|
95 |
// check BSF's |
|
96 |
IBSFCatalog catalog = getSDK().getBSFCatalog(); |
|
97 |
if (catalog != null) { |
|
98 |
for (IBSFPlatform plat : catalog.getPlatforms()) { |
|
99 |
if (plat.getName().compareToIgnoreCase(platform) == 0) { |
|
100 |
String mainPlatform = catalog.getReleasePlatform(platform); |
|
101 |
if (mainPlatform != null) { |
|
102 |
dirName = getDefFileDirectoryNameForPlatform(mainPlatform); |
|
103 |
if (dirName == null || dirName.length() < 1) { |
|
104 |
// fallback - all BSF's should be EABI anyway |
|
105 |
return "EABI"; //$NON-NLS-1$ |
|
106 |
} |
|
107 |
} |
|
108 |
} |
|
109 |
} |
|
110 |
} |
|
111 |
} |
|
112 |
||
113 |
if (dirName == null) { |
|
114 |
// fallback for unknown cases |
|
115 |
dirName = platform; |
|
116 |
} |
|
117 |
||
118 |
return dirName; |
|
119 |
} |
|
120 |
||
121 |
private String getDefFileDirectoryNameForPlatform(String platform) { |
|
122 |
// TODO: This is still ABLD stype stuff |
|
123 |
if (platform.equals(EMULATOR_PLATFORM)) { |
|
124 |
return "BWINS"; //$NON-NLS-1$ |
|
125 |
} else if (platform.equals(ARMV5_PLATFORM) |
|
126 |
|| platform.equals(ARMV5_ABIV2_PLATFORM) |
|
127 |
|| platform.equals(ARMV6_PLATFORM) |
|
128 |
|| platform.equals(ARMV6_ABIV2_PLATFORM) |
|
129 |
|| platform.equals(GCCE_PLATFORM)) { |
|
130 |
return "EABI"; //$NON-NLS-1$ |
|
131 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
132 |
return null; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
133 |
} |
1419 | 134 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
135 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
136 |
public IPath getCompilerPrefixFile() { |
1419 | 137 |
// TODO: This is ABLD hard-code mechanism. Should be able to get from Raptor query mechanism |
138 |
if (platform.equals(GCCE_PLATFORM)) { |
|
139 |
return getGCCEPrefixFilePath(); |
|
140 |
} else if (platform.equals(ARMV5_PLATFORM) |
|
141 |
|| platform.equals(ARMV5_ABIV2_PLATFORM) |
|
142 |
|| platform.equals(ARMV6_PLATFORM) |
|
143 |
|| platform.equals(ARMV6_ABIV2_PLATFORM)) { |
|
144 |
return getRVCTPrefixFilePath(); |
|
145 |
} else { |
|
146 |
// check BSF's |
|
147 |
IBSFCatalog catalog = getSDK().getBSFCatalog(); |
|
148 |
if (catalog != null) { |
|
149 |
for (IBSFPlatform plat : catalog.getPlatforms()) { |
|
150 |
if (plat.getName().compareToIgnoreCase(platform) == 0) { |
|
151 |
String mainPlatform = catalog.getReleasePlatform(platform); |
|
152 |
if (mainPlatform != null) { |
|
153 |
if (mainPlatform.equals(GCCE_PLATFORM)) { |
|
154 |
return getGCCEPrefixFilePath(); |
|
155 |
} else if (mainPlatform.equals(ARMV5_PLATFORM) |
|
156 |
|| mainPlatform.equals(ARMV5_ABIV2_PLATFORM) |
|
157 |
|| mainPlatform.equals(ARMV6_PLATFORM) |
|
158 |
|| mainPlatform.equals(ARMV6_ABIV2_PLATFORM)) { |
|
159 |
return getRVCTPrefixFilePath(); |
|
160 |
} else { |
|
161 |
// fallback - all BSF's should be EABI anyway |
|
162 |
return getRVCTPrefixFilePath(); |
|
163 |
} |
|
164 |
} |
|
165 |
} |
|
166 |
} |
|
167 |
} |
|
168 |
} |
|
169 |
||
170 |
// fallback for WINSCW, MSVC, etc. |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
171 |
return null; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
172 |
} |
1419 | 173 |
|
174 |
private IPath getGCCEPrefixFilePath() { |
|
175 |
// TOOD: Should get from Raptor query when available |
|
176 |
return getSDK().getIncludePath().append("gcce/gcce.h"); //$NON-NLS-1$ |
|
177 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
178 |
|
1419 | 179 |
private IPath getRVCTPrefixFilePath() { |
180 |
// TODO: Should get this from query mechanism |
|
181 |
IRVCTToolChainInfo[] installedRVCTTools = SDKCorePlugin.getSDKManager().getInstalledRVCTTools(); |
|
182 |
// use default in case tools aren't installed |
|
183 |
String rvctFragment = "rvct2_2"; //$NON-NLS-1$ |
|
184 |
if (installedRVCTTools.length > 0) { |
|
185 |
rvctFragment = getRVCTFragment(installedRVCTTools[0]); |
|
186 |
} |
|
187 |
IPath prefixFilePath = getSDK().getIncludePath().append(rvctFragment).append(rvctFragment + ".h"); //$NON-NLS-1$ |
|
188 |
if (prefixFilePath.toFile().exists()){ |
|
189 |
return prefixFilePath; |
|
190 |
} else { |
|
191 |
// SF kits around SF^3 started to only use a single rvct.h header instead of specific versioned ones |
|
192 |
// based on the default installation |
|
193 |
return getSDK().getIncludePath().append("rvct").append("rvct" + ".h"); |
|
194 |
} |
|
195 |
} |
|
196 |
||
197 |
private String getRVCTFragment(IRVCTToolChainInfo info) { |
|
198 |
// TODO: This should not be needed when raptor query is complete |
|
199 |
int major = 0, minor = 0; |
|
200 |
if (info != null) { |
|
201 |
Version rvctToolsVersion = info.getRvctToolsVersion(); |
|
202 |
if (rvctToolsVersion != null) { |
|
203 |
major = info.getRvctToolsVersion().getMajor(); |
|
204 |
minor = info.getRvctToolsVersion().getMinor(); |
|
205 |
} |
|
206 |
} |
|
207 |
return "rvct" + major + "_" + minor; //$NON-NLS-1$ //$NON-NLS-2$ |
|
208 |
} |
|
209 |
||
1418
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 List<IDefine> getVariantHRHDefines() { |
1419 | 212 |
// TODO: Should get from raptor query |
213 |
return getCachedData().getVariantHRHDefines(); |
|
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 List<File> getPrefixFileIncludes() { |
1419 | 218 |
// TODO: Should get from raptor query |
219 |
return getCachedData().getPrefixFileIncludes(); |
|
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 List<IDefine> getCompilerMacros() { |
1419 | 224 |
// TODO: Should get from raptor query |
225 |
// we parse the compiler prefix file to gather macros. this can be time consuming so do it |
|
226 |
// once and cache the values. only reset the cache when the compiler prefix has changed. |
|
227 |
||
228 |
IPath prefixFile = getCompilerPrefixFile(); |
|
229 |
if (prefixFile == null) { |
|
230 |
return Collections.emptyList(); |
|
231 |
} |
|
232 |
||
233 |
return getCachedData().getCompilerMacros(prefixFile); |
|
1418
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 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
236 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
237 |
public String getBuildVariationName() { |
1419 | 238 |
// TODO: This should not be needed for Raptor |
239 |
return ""; |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
240 |
} |
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 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
243 |
public boolean isSymbianBinaryVariation() { |
1419 | 244 |
// This should not be needed for Raptor. We do need a check |
245 |
// in the MPP for the featurevariant keyword perhaps |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
246 |
return false; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
247 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
248 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
249 |
/** |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
250 |
* 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
|
251 |
* @param displayName |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
252 |
* @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
|
253 |
*/ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
254 |
private static String getSBSv2AliasFromConfigName(String displayName) { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
255 |
int indexBegin = displayName.indexOf("("); //$NON-NLS-1$ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
256 |
int indexEnd = displayName.indexOf(")"); //$NON-NLS-1$ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
257 |
if (indexBegin > 0 && indexEnd > 0){ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
258 |
String configPart = displayName.substring(indexBegin+1, indexEnd); |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
259 |
if (configPart.split("_").length > 1){ |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
260 |
return configPart; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
261 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
262 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
263 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
264 |
return null; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
265 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
266 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
267 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
268 |
public String getSBSv2Alias() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
269 |
return sbsv2Alias; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
270 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
271 |
|
1419 | 272 |
/** |
273 |
* Get the cache holding the data that applies to this build context globally. |
|
274 |
* A build context is subclassed by CarbideBuildConfiguration, which has multiple |
|
275 |
* instances at runtime, thus, a SymbianBuildContext instance should not hold a cache itself. |
|
276 |
* @return cache, never <code>null</code> |
|
277 |
*/ |
|
278 |
private SymbianBuildContextDataCache getCachedData() { |
|
279 |
// TODO: Still need to consider this for SBSv2 refactoring / Raptor query |
|
280 |
return SymbianBuildContextDataCache.getCache(this); |
|
281 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
282 |
|
1419 | 283 |
/** |
284 |
* Get the list of #include paths detected for this context. |
|
285 |
* @return List or <code>null</code> |
|
286 |
*/ |
|
287 |
public List<File> getCachedSystemIncludePaths() { |
|
288 |
// TODO: Still need to consider this for SBSv2 refactoring / Raptor query |
|
289 |
return getCachedData().getSystemIncludePaths(); |
|
290 |
} |
|
1420
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
291 |
|
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
292 |
|
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
293 |
// 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
|
294 |
public static String getSDKIDFromConfigName(String configName) { |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
295 |
int indexBegin = configName.indexOf("["); //$NON-NLS-1$ |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
296 |
int indexEnd = configName.indexOf("]"); //$NON-NLS-1$ |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
297 |
if (indexBegin > 0 && indexEnd > 0){ |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
298 |
return configName.substring(indexBegin+1, indexEnd); |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
299 |
} else { |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
300 |
return ""; //$NON-NLS-1$ |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
301 |
} |
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
302 |
} |
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
|
303 |
|
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 |
@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
|
305 |
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
|
306 |
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
|
307 |
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
|
308 |
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
|
309 |
+ ((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
|
310 |
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
|
311 |
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
|
312 |
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
|
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 |
|
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
|
315 |
|
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
|
316 |
@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
|
317 |
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
|
318 |
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
|
319 |
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
|
320 |
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
|
321 |
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
|
322 |
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
|
323 |
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
|
324 |
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
|
325 |
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
|
326 |
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
|
327 |
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
|
328 |
} 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
|
329 |
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
|
330 |
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
|
331 |
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
|
332 |
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
|
333 |
} 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
|
334 |
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
|
335 |
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
|
336 |
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
|
337 |
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
|
338 |
} 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
|
339 |
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
|
340 |
} |
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
|
341 |
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
|
342 |
} |
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
|
343 |
|
1420
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
344 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
345 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
346 |
} |