author | stechong |
Thu, 15 Jul 2010 23:28:04 -0500 | |
branch | C3_BUILDER_WORK |
changeset 1621 | 393b985a50f3 |
parent 1568 | 508bfdb3a934 |
child 1643 | 3fb715ff2227 |
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; |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
4 |
import java.text.MessageFormat; |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
5 |
import java.util.ArrayList; |
1419 | 6 |
import java.util.Collections; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
7 |
import java.util.List; |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
8 |
import java.util.Map; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
9 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
10 |
import org.eclipse.core.runtime.IPath; |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
11 |
import org.eclipse.core.runtime.IStatus; |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
12 |
import org.eclipse.core.runtime.Path; |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
13 |
import org.eclipse.jface.dialogs.MessageDialog; |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
14 |
import org.eclipse.ui.PlatformUI; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
15 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
16 |
import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
17 |
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2ConfigQueryData; |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
18 |
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2MinimumVersionException; |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
19 |
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2QueryUtils; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
20 |
import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext; |
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
21 |
import com.nokia.carbide.cpp.sdk.core.ISBSv2ConfigQueryData; |
1420
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
22 |
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
23 |
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; |
1419 | 24 |
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
|
25 |
import com.nokia.cpp.internal.api.utils.core.Check; |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
26 |
import com.nokia.cpp.internal.api.utils.core.Logging; |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
27 |
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
28 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
29 |
public class BuildContextSBSv2 implements ISBSv2BuildContext { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
30 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
31 |
private String platform; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
32 |
private String target; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
33 |
private String sbsv2Alias; |
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
34 |
private ISymbianSDK sdk; |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
35 |
private String displayString; |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
36 |
private String configID; // cconfiguration 'id' attribute from .cproject |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
37 |
|
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
38 |
// Raptor config query data |
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
39 |
private ISBSv2ConfigQueryData configQueryData; |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
40 |
|
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
41 |
public BuildContextSBSv2(ISymbianSDK sdk, String platform, String target, String alias, String displayString, String configID) { |
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
42 |
this.sdk = sdk; |
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
43 |
this.platform = platform.toUpperCase(); |
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
44 |
this.target = target.toUpperCase(); |
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
45 |
this.sbsv2Alias = alias; |
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
46 |
this.displayString = displayString; |
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
47 |
this.configID = configID; |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
48 |
this.configQueryData = setConfigQueryData(sdk, alias); |
1418
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 |
|
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
51 |
public BuildContextSBSv2(ISymbianSDK sdk, String alias, ISBSv2ConfigQueryData configData) { |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
52 |
this.sdk = sdk; |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
53 |
this.sbsv2Alias = alias; |
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
54 |
this.configQueryData = configData; |
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
55 |
setPlatformAndTargetFromOutputPath(); |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
56 |
this.configID = ISBSv2BuildContext.BUILDER_ID + "." + sbsv2Alias + "." + sdk.getUniqueId(); |
1491
268b8ede3928
Update the SBSv2 filtering pref options from the Raptor alias query (union of all available build configs from Raptor).
timkelly
parents:
1480
diff
changeset
|
57 |
this.displayString = sbsv2Alias + " [" + sdk.getUniqueId() + "]"; |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
58 |
} |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
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 ISymbianSDK getSDK() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
62 |
return sdk; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
63 |
} |
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 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
66 |
public String getPlatformString() { |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
67 |
|
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
68 |
if (platform == null){ |
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
69 |
return configQueryData.getConfigurationErrorMessage(); |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
70 |
} |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
71 |
|
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
72 |
if (platform.contains(".")){ |
1491
268b8ede3928
Update the SBSv2 filtering pref options from the Raptor alias query (union of all available build configs from Raptor).
timkelly
parents:
1480
diff
changeset
|
73 |
String[] tok = platform.split("."); |
268b8ede3928
Update the SBSv2 filtering pref options from the Raptor alias query (union of all available build configs from Raptor).
timkelly
parents:
1480
diff
changeset
|
74 |
if (tok.length > 0) return tok[0]; |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
75 |
} |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
76 |
return platform; |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
77 |
} |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
78 |
|
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
79 |
public String getPlatformReleaseDirName() { |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
80 |
return platform; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
81 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
82 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
83 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
84 |
public String getTargetString() { |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
85 |
if (target == null){ |
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
86 |
return configQueryData.getConfigurationErrorMessage(); |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
87 |
} |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
88 |
return target; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
89 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
90 |
|
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
91 |
public String getConfigID(){ |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
92 |
return configID; |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
93 |
} |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
94 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
95 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
96 |
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
|
97 |
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
|
98 |
return displayString; |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
99 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
100 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
101 |
@Override |
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
102 |
public String toString() { |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
103 |
return getConfigID(); |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
104 |
} |
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
105 |
|
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
106 |
@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
|
107 |
public String getDefaultDefFileDirectoryName() { |
1479
a654857ddb87
refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents:
1478
diff
changeset
|
108 |
|
1419 | 109 |
String dirName = getDefFileDirectoryNameForPlatform(platform); |
110 |
||
111 |
if (dirName == null) { |
|
112 |
// fallback for unknown cases |
|
113 |
dirName = platform; |
|
114 |
} |
|
115 |
||
116 |
return dirName; |
|
117 |
} |
|
118 |
||
119 |
private String getDefFileDirectoryNameForPlatform(String platform) { |
|
1479
a654857ddb87
refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents:
1478
diff
changeset
|
120 |
if (sbsv2Alias.toUpperCase().contains("WINSCW")) { |
1419 | 121 |
return "BWINS"; //$NON-NLS-1$ |
1479
a654857ddb87
refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents:
1478
diff
changeset
|
122 |
} else if (sbsv2Alias.toUpperCase().contains("ARM")) { |
1419 | 123 |
return "EABI"; //$NON-NLS-1$ |
124 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
125 |
return null; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
126 |
} |
1419 | 127 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
128 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
129 |
public IPath getCompilerPrefixFile() { |
1479
a654857ddb87
refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents:
1478
diff
changeset
|
130 |
|
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
131 |
if (sbsv2Alias.toUpperCase().contains(TOOLCHAIN_GCCE) || |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
132 |
sbsv2Alias.toUpperCase().contains(TOOLCHAIN_ARM)) { |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
133 |
if (configQueryData != null) { |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
134 |
return new Path(configQueryData.getBuildPrefix()); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
135 |
} |
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
|
136 |
} |
1419 | 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 |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
142 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
143 |
public List<IDefine> getVariantHRHDefines() { |
1419 | 144 |
return getCachedData().getVariantHRHDefines(); |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
145 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
146 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
147 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
148 |
public List<File> getPrefixFileIncludes() { |
1419 | 149 |
return getCachedData().getPrefixFileIncludes(); |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
150 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
151 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
152 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
153 |
public List<IDefine> getCompilerMacros() { |
1419 | 154 |
IPath prefixFile = getCompilerPrefixFile(); |
155 |
if (prefixFile == null) { |
|
156 |
return Collections.emptyList(); |
|
157 |
} |
|
158 |
||
159 |
return getCachedData().getCompilerMacros(prefixFile); |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
160 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
161 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
162 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
163 |
public String getBuildVariationName() { |
1419 | 164 |
// TODO: This should not be needed for Raptor |
165 |
return ""; |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
166 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
167 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
168 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
169 |
public boolean isSymbianBinaryVariation() { |
1419 | 170 |
// This should not be needed for Raptor. We do need a check |
171 |
// in the MPP for the featurevariant keyword perhaps |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
172 |
return false; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
173 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
174 |
|
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
175 |
@Override |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
176 |
public String getSBSv2Alias() { |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
177 |
return sbsv2Alias; |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
178 |
} |
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
179 |
|
1419 | 180 |
/** |
181 |
* Get the cache holding the data that applies to this build context globally. |
|
182 |
* A build context is subclassed by CarbideBuildConfiguration, which has multiple |
|
183 |
* instances at runtime, thus, a SymbianBuildContext instance should not hold a cache itself. |
|
184 |
* @return cache, never <code>null</code> |
|
185 |
*/ |
|
186 |
private SymbianBuildContextDataCache getCachedData() { |
|
187 |
return SymbianBuildContextDataCache.getCache(this); |
|
188 |
} |
|
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
189 |
|
1419 | 190 |
/** |
191 |
* Get the list of #include paths detected for this context. |
|
192 |
* @return List or <code>null</code> |
|
193 |
*/ |
|
194 |
public List<File> getCachedSystemIncludePaths() { |
|
195 |
return getCachedData().getSystemIncludePaths(); |
|
196 |
} |
|
1420
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
197 |
|
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
|
198 |
@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
|
199 |
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
|
200 |
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
|
201 |
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
|
202 |
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
|
203 |
+ ((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
|
204 |
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
|
205 |
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
|
206 |
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
|
207 |
} |
7903a1588fd4
more work to keep SBSv2 and SBSV1 working after refactoring. I think we are back to functional parity as before the refactoring now.
timkelly
parents:
1423
diff
changeset
|
208 |
|
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
|
209 |
|
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
|
210 |
@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
|
211 |
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
|
212 |
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
|
213 |
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
|
214 |
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
|
215 |
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
|
216 |
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
|
217 |
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
|
218 |
final BuildContextSBSv2 other = (BuildContextSBSv2) obj; |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
219 |
if (!configID.equalsIgnoreCase(other.configID)){ |
1433
1a693b01d107
1) Reworking cconfiguration 'id' to be separate from the config display name
timkelly
parents:
1425
diff
changeset
|
220 |
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
|
221 |
} |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
222 |
return true; |
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
|
223 |
} |
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
|
224 |
|
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
|
225 |
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
|
226 |
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
|
227 |
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
|
228 |
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
|
229 |
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
|
230 |
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
|
231 |
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
|
232 |
} 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
|
233 |
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
|
234 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
235 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
236 |
|
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
237 |
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
|
238 |
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
|
239 |
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
|
240 |
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
|
241 |
} 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
|
242 |
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
|
243 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
244 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
245 |
|
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
246 |
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
|
247 |
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
|
248 |
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
|
249 |
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
|
250 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
251 |
|
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
252 |
// 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
|
253 |
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
|
254 |
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
|
255 |
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
|
256 |
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
|
257 |
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
|
258 |
} 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
|
259 |
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
|
260 |
} |
03403c6a4740
Fixing up bug 11025 to load SBSv2 build contexts for older config names (no project config conversions done).
timkelly
parents:
1437
diff
changeset
|
261 |
} |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
262 |
|
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
263 |
private void setPlatformAndTargetFromOutputPath() { |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
264 |
if (configQueryData.getOutputPathString() == null) { |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
265 |
platform = ""; |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
266 |
target = ""; |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
267 |
return; |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
268 |
} |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
269 |
|
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
270 |
IPath releasePath = new Path(configQueryData.getOutputPathString()); |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
271 |
int epoc32SegmentIndex = 0; |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
272 |
for (String segment : releasePath.segments()){ |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
273 |
if (segment.toLowerCase().equals("epoc32")) |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
274 |
break; |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
275 |
epoc32SegmentIndex++; |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
276 |
} |
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
277 |
// assuming /epoc32/<release>/<target>/ |
1621
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
278 |
platform = releasePath.segment(epoc32SegmentIndex+2).toUpperCase(); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
279 |
target = releasePath.segment(epoc32SegmentIndex+3).toUpperCase(); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
280 |
} |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
281 |
|
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
282 |
private ISBSv2ConfigQueryData setConfigQueryData(ISymbianSDK sdk, String alias) { |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
283 |
SBSv2ConfigQueryData configQueryData = null; |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
284 |
try { |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
285 |
configQueryData = SBSv2QueryUtils.getConfigQueryDataForSDK(sdk, alias); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
286 |
if (configQueryData == null) { |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
287 |
Map<String, String> aliasToMeaningMap = SBSv2QueryUtils.getAliasesForSDK(sdk); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
288 |
List<String> aliasList = new ArrayList<String>(); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
289 |
aliasList.add(alias); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
290 |
String configQueryXML = SBSv2QueryUtils.getConfigQueryXMLforSDK(sdk, aliasList); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
291 |
if (aliasToMeaningMap.get(alias) != null){ |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
292 |
configQueryData = new SBSv2ConfigQueryData(alias, aliasToMeaningMap.get(alias), configQueryXML); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
293 |
} |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
294 |
} |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
295 |
} catch (final SBSv2MinimumVersionException e) { |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
296 |
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
297 |
public void run() { |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
298 |
MessageDialog.openError(WorkbenchUtils.getSafeShell(), "Minimum sbs version not met.", e.getMessage()); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
299 |
} |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
300 |
}); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
301 |
Logging.log(SDKCorePlugin.getDefault(), Logging.newSimpleStatus(0, IStatus.ERROR, |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
302 |
MessageFormat.format(e.getMessage(), ""), e)); |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
303 |
} |
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
304 |
|
393b985a50f3
Raptor scanner discovery on top of new Raptor Query API.
stechong
parents:
1568
diff
changeset
|
305 |
return configQueryData; |
1476
09e768e53db5
first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents:
1471
diff
changeset
|
306 |
} |
1420
9dfc6e3dc4b9
more ISymbianBuildCOntext refactoring to get SBSv1 & SBSv2 working to origianl state
timkelly
parents:
1419
diff
changeset
|
307 |
|
1568
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
308 |
public ISBSv2ConfigQueryData getConfigQueryData() { |
508bfdb3a934
Added caching of Raptor query data for aliases, products and configs.
stechong
parents:
1521
diff
changeset
|
309 |
return configQueryData; |
1521 | 310 |
} |
1418
8ca7cf978139
first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff
changeset
|
311 |
} |