--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java Thu May 27 10:01:09 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java Thu May 27 13:45:14 2010 -0500
@@ -1022,6 +1022,9 @@
if (!bldInfoFile.exists())
return;
+ if (getOSVersion().getMajor() == 0)
+ setOSVersion(new Version("9.5.0")); // Set a default version that will work with all EKA2
+
try {
char[] cbuf = new char[(int) bldInfoFile.length()];
Reader reader = new FileReader(bldInfoFile);
@@ -1038,12 +1041,16 @@
if (line.startsWith(BUILD_INFO_KEYWORD)){
String[] versionTokens = line.split(" ");
if (versionTokens.length == 3){
-
- if (versionTokens[2].toUpperCase().startsWith("TB92SF") || versionTokens[2].toUpperCase().endsWith("TB92SF")){
+
+ if (versionTokens[2].toUpperCase().contains("TB92SF")){
setOSVersion(new Version("9.5.0"));
setSDKVersion(new Version("5.2.0"));
break;
- } else if (versionTokens[2].toUpperCase().startsWith("TB101SF") || versionTokens[2].toUpperCase().endsWith("TB101SF")){
+ } else if (versionTokens[2].toUpperCase().contains("TB101SF")){
+ setOSVersion(new Version("9.6.0"));
+ setSDKVersion(new Version("6.0.0"));
+ break;
+ } else if (versionTokens[2].toUpperCase().contains("TB102SF")){
setOSVersion(new Version("9.6.0"));
setSDKVersion(new Version("6.0.0"));
break;
@@ -1052,24 +1059,6 @@
int index = versionTokens[2].lastIndexOf("v");
String osVersionString = versionTokens[2].substring(index+1, versionTokens[2].length());
- if (osVersionString.compareToIgnoreCase("tb91sf") == 0){
- setOSVersion(new Version("9.4.0"));
- setSDKVersion(new Version("5.1.0"));
- break;
- }
-
- if (osVersionString.compareToIgnoreCase("tb92sf") == 0){
- setOSVersion(new Version("9.5.0"));
- setSDKVersion(new Version("5.2.0"));
- break;
- }
-
- if (osVersionString.compareToIgnoreCase("tb101sf") == 0){
- setOSVersion(new Version("9.6.0"));
- setSDKVersion(new Version("6.0.0"));
- break;
- }
-
if (osVersionString.endsWith(EKA1_A_BRANCH_IDENTIFIER) ||
osVersionString.endsWith(EKA2_B_BRANCH_IDENTIFIER) ||
osVersionString.endsWith(EKA1_S_BRANCH_IDENTIFIER)){
@@ -1081,9 +1070,14 @@
}
// Set the version, split on alphanumeric to get rid of any junk at the end
- String[] tempStr = osVersionString.split("[a-zA-Z]");
+ String[] tempStr = osVersionString.split("[a-zA-Z_]");
if (tempStr.length != 0){
- setOSVersion(Version.parseVersion(tempStr[0]));
+ try {
+ setOSVersion(Version.parseVersion(tempStr[0]));
+ } catch (Exception e) {
+ // ignore, default version already set
+ // just catch exception so we move along to the next SDK
+ }
}
}
}