Fix several issues for Linux around casting SDKManager to concrete class:
mostly with reading devices.xml which Unix does not support. Migrated
ISDKManager#getMinimumSupportedSBSv2Version() to API. Can now import and create Symbian projects.
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/SBSv2QueryTests.java Tue Aug 17 08:39:31 2010 -0700
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/SBSv2QueryTests.java Tue Aug 17 10:53:02 2010 -0700
@@ -42,7 +42,7 @@
@Override
protected void setUp() throws Exception {
super.setUp();
- Version sbsVersion = ((SDKManager)SDKCorePlugin.getSDKManager()).getSBSv2Version(true);
+ Version sbsVersion = SDKCorePlugin.getSDKManager().getSBSv2Version(true);
if ((sbsVersion.getMajor() == 2 && sbsVersion.getMinor() < 15) ||
sbsVersion.getMajor() < 2){
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/ManageConfigurationsDialog.java Tue Aug 17 08:39:31 2010 -0700
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/ManageConfigurationsDialog.java Tue Aug 17 10:53:02 2010 -0700
@@ -67,6 +67,7 @@
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetTreeNode;
import com.nokia.cpp.internal.api.utils.core.Check;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
@SuppressWarnings("restriction")
@@ -148,12 +149,14 @@
this.cpi = cpi;
setShellStyle(getShellStyle() | SWT.RESIZE);
- ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
- if (!((SDKManager)sdkMgr).checkDevicesXMLSynchronized()){
- if (sdkMgr instanceof ISDKManagerInternal){
- ISDKManagerInternal sdkMgrInternal = (ISDKManagerInternal)sdkMgr;
- sdkMgrInternal.fireDevicesXMLChanged();
- }
+ if (HostOS.IS_WIN32){
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
+ if (!((SDKManager)sdkMgr).checkDevicesXMLSynchronized()){
+ if (sdkMgr instanceof ISDKManagerInternal){
+ ISDKManagerInternal sdkMgrInternal = (ISDKManagerInternal)sdkMgr;
+ sdkMgrInternal.fireDevicesXMLChanged();
+ }
+ }
}
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java Tue Aug 17 08:39:31 2010 -0700
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java Tue Aug 17 10:53:02 2010 -0700
@@ -48,7 +48,7 @@
import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
import com.nokia.carbide.cpp.internal.api.sdk.SDKCacheUtils;
-import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager;
+import com.nokia.carbide.cpp.sdk.core.ISDKManager;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
import com.nokia.cpp.internal.api.utils.core.Logging;
@@ -413,7 +413,7 @@
}
private static boolean checkForMinimumRaptorVersion() throws SBSv2MinimumVersionException{
- SDKManager sdkMgr = (SDKManager)SDKCorePlugin.getSDKManager();
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
Version sbsVers = sdkMgr.getSBSv2Version(false);
if (sbsVers.compareTo(sdkMgr.getMinimumSupportedSBSv2Version()) >= 0)
return true;
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKManager.java Tue Aug 17 08:39:31 2010 -0700
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKManager.java Tue Aug 17 10:53:02 2010 -0700
@@ -117,4 +117,11 @@
*/
public Version getSBSv2Version(boolean forceScan);
+ /**
+ * Retrieve the minimum supported version of SBSv2 for Carbide.c++
+ * @return Version
+ * @since 3.0
+ */
+ public Version getMinimumSupportedSBSv2Version();
+
}
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Tue Aug 17 08:39:31 2010 -0700
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Tue Aug 17 10:53:02 2010 -0700
@@ -51,6 +51,7 @@
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
/**
* @since 1.4
@@ -294,13 +295,20 @@
public void setDefaults(){
initTable();
for (TableItem item : buildAliasTableViewer.getTable().getItems()) {
- if (item.getText().toLowerCase().equals("armv5_udeb") ||
- item.getText().toLowerCase().equals("armv5_urel") ||
- item.getText().toLowerCase().equals("armv5_udeb_gcce") ||
- item.getText().toLowerCase().equals("armv5_urel_gcce") ||
- item.getText().toLowerCase().equals("winscw_udeb") ||
- item.getText().toLowerCase().equals("winscw_urel")) {
- buildAliasTableViewer.setChecked(item.getData(), true);
+ String tableItemText = item.getText().toLowerCase();
+ if (tableItemText.equals("armv5_udeb") ||
+ tableItemText.equals("armv5_urel") ||
+ tableItemText.equals("armv5_udeb_gcce") ||
+ tableItemText.equals("armv5_urel_gcce") ||
+ tableItemText.equals("winscw_udeb") ||
+ tableItemText.equals("winscw_urel")) {
+
+ if (HostOS.IS_UNIX && tableItemText.startsWith("winscw"))
+ ; // ignore winscw as an option for Unix
+ else
+ buildAliasTableViewer.setChecked(item.getData(), true);
+
+
} else {
buildAliasTableViewer.setChecked(item.getData(), false);
}
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ImporterBuildTargetsPage.java Tue Aug 17 08:39:31 2010 -0700
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ImporterBuildTargetsPage.java Tue Aug 17 10:53:02 2010 -0700
@@ -27,6 +27,7 @@
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildContext;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo;
+import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager;
import com.nokia.carbide.cpp.sdk.core.IBSFCatalog;
import com.nokia.carbide.cpp.sdk.core.ISDKManager;
@@ -35,6 +36,7 @@
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetsPage;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
public class ImporterBuildTargetsPage extends BuildTargetsPage {
@@ -77,13 +79,17 @@
TreeNode node = (TreeNode)items[i].getData();
if (node.getValue() instanceof ISymbianSDK && node.getValue() == sdk) {
IBSFCatalog bsfCatalog = null;
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
+ ISBSv1BuildInfo sbsv1BuildInfo = null;
+ if (SBSv2Utils.enableSBSv1Support()){
+ sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
+ }
+
ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
if (sbsv1BuildInfo != null) {
// SBSv1 only
bsfCatalog = sbsv1BuildInfo.getBSFCatalog();
}
- if (((SDKManager)sdkMgr).getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){
+ if (HostOS.IS_WIN32 && (((SDKManager)sdkMgr).getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0))){
// Check and see if any of the configs in the SDK
// match any configuration that has been selected before
// for this SDK.
@@ -142,12 +148,13 @@
// SBSv1 only
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
bsfCatalog = sbsv1BuildInfo.getBSFCatalog();
+
+ if (((SDKManager)sdkMgr).getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){
+ // this setting needs to be persisted.
+ settingsNeedUpdate = true;
+ selectedConfigsToSave.add(currContext);
+ }
}
- if (((SDKManager)sdkMgr).getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){
- // this setting needs to be persisted.
- settingsNeedUpdate = true;
- selectedConfigsToSave.add(currContext);
- }
}
if (settingsNeedUpdate) {
// Iterate through all the persisted configs and don't add those that have the same
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/sharedui/BuilderSelectionComposite.java Tue Aug 17 08:39:31 2010 -0700
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/sharedui/BuilderSelectionComposite.java Tue Aug 17 10:53:02 2010 -0700
@@ -30,6 +30,7 @@
import com.nokia.carbide.cpp.internal.project.ui.Messages;
import com.nokia.carbide.cpp.internal.project.ui.ProjectUIPlugin;
import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager;
+import com.nokia.carbide.cpp.sdk.core.ISDKManager;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetsPage;
@@ -90,7 +91,7 @@
useSBSv2Builder = false;
}
else if (selection.equals(Messages.getString("NewProjectPage.sbsv2"))) { //$NON-NLS-1$
- SDKManager sdkMgr = (SDKManager)SDKCorePlugin.getSDKManager();
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
// if SBSv2 is selected, make sure SBS bin directory exists
if (SBSv2Utils.getSBSBinDirectory() == null){
status = new Status(Status.ERROR, ProjectUIPlugin.PLUGIN_ID, "The Symbian Build System (sbs) cannot be found on the PATH. Carbide needs a valid SBS installation on the PATH to use the SBSv2 builder.");
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/wizards/NewSymbianOSCppProjectWizard.java Tue Aug 17 08:39:31 2010 -0700
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/wizards/NewSymbianOSCppProjectWizard.java Tue Aug 17 10:53:02 2010 -0700
@@ -35,6 +35,7 @@
import com.nokia.carbide.cpp.ui.ICarbideSharedImages;
import com.nokia.carbide.internal.api.templatewizard.ui.IWizardDataPage;
import com.nokia.carbide.internal.api.templatewizard.ui.TemplateWizard;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
/**
* Wizard for creating Symbian OS C++ project
@@ -52,13 +53,15 @@
setTemplateFilter(new TemplateSDKsFilter());
setWindowTitle(Messages.getString("NewSymbianOSCppProjectWizard.WindowTitle")); //$NON-NLS-1$
- ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
- if (!((SDKManager)sdkMgr).checkDevicesXMLSynchronized()){
- if (sdkMgr instanceof ISDKManagerInternal){
- ISDKManagerInternal sdkMgrInternal = (ISDKManagerInternal)sdkMgr;
- sdkMgrInternal.fireDevicesXMLChanged();
+ if (HostOS.IS_WIN32){
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
+ if (!((SDKManager)sdkMgr).checkDevicesXMLSynchronized()){
+ if (sdkMgr instanceof ISDKManagerInternal){
+ ISDKManagerInternal sdkMgrInternal = (ISDKManagerInternal)sdkMgr;
+ sdkMgrInternal.fireDevicesXMLChanged();
+ }
+
}
-
}
}
--- a/qt/com.nokia.carbide.cpp.qt.ui/META-INF/MANIFEST.MF Tue Aug 17 08:39:31 2010 -0700
+++ b/qt/com.nokia.carbide.cpp.qt.ui/META-INF/MANIFEST.MF Tue Aug 17 10:53:02 2010 -0700
@@ -23,6 +23,7 @@
org.eclipse.cdt.core,
org.eclipse.ui.ide,
com.trolltech.qtcppproject;bundle-version="1.6.0";resolution:=optional,
- com.nokia.cpp.utils.ui
+ com.nokia.cpp.utils.ui,
+ com.nokia.cpp.utils.core;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
--- a/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtProFileImportWizard.java Tue Aug 17 08:39:31 2010 -0700
+++ b/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtProFileImportWizard.java Tue Aug 17 10:53:02 2010 -0700
@@ -48,6 +48,7 @@
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
import com.trolltech.qtcppproject.QtProject;
import com.trolltech.qtcppproject.qmake.QMakeRunner;
@@ -66,11 +67,13 @@
setDialogSettings(section);
setNeedsProgressMonitor(true);
- ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
- if (!((SDKManager)sdkMgr).checkDevicesXMLSynchronized()){
- if (sdkMgr instanceof ISDKManagerInternal){
- ISDKManagerInternal sdkMgrInternal = (ISDKManagerInternal)sdkMgr;
- sdkMgrInternal.fireDevicesXMLChanged();
+ if (HostOS.IS_WIN32){
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
+ if (!((SDKManager)sdkMgr).checkDevicesXMLSynchronized()){
+ if (sdkMgr instanceof ISDKManagerInternal){
+ ISDKManagerInternal sdkMgrInternal = (ISDKManagerInternal)sdkMgr;
+ sdkMgrInternal.fireDevicesXMLChanged();
+ }
}
}
}