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