Add support for qmke command provider extension. RCL_2_4
authortimkelly
Thu, 25 Feb 2010 10:20:24 -0600
branchRCL_2_4
changeset 1019 ef5a4ad94acf
parent 1017 82708fe77230
child 1020 ea77505ba5f6
child 1030 eb7c68bd438d
Add support for qmke command provider extension.
qt/com.nokia.carbide.cpp.qt.ui/plugin.xml
qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/CarbideQmakeCommandProvider.java
qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/processes/ProjectCreatedTasksQt.java
--- a/qt/com.nokia.carbide.cpp.qt.ui/plugin.xml	Wed Feb 24 15:58:49 2010 -0600
+++ b/qt/com.nokia.carbide.cpp.qt.ui/plugin.xml	Thu Feb 25 10:20:24 2010 -0600
@@ -97,5 +97,14 @@
             name="com.nokia.carbide.cpp.internal.qt.core.SDK-HookClient"/>
    </extension>
    
+    <extension
+         id="com.nokia.carbide.cpp.internal.qt.ui.qmakeCommandProvider"
+         name="Qt qmake command provider"
+         point="com.trolltech.qtcppproject.qmakeCommandProvider">
+          <provider
+            class="com.nokia.carbide.cpp.internal.qt.ui.CarbideQmakeCommandProvider"
+            name="com.nokia.carbide.cpp.internal.qt.ui.CarbideQmakeCommandProvider"/>
+   </extension>
+   
 
 </plugin>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/CarbideQmakeCommandProvider.java	Thu Feb 25 10:20:24 2010 -0600
@@ -0,0 +1,50 @@
+package com.nokia.carbide.cpp.internal.qt.ui;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.trolltech.qtcppproject.qmake.IQtQmakeCommandProvider;
+
+public class CarbideQmakeCommandProvider implements IQtQmakeCommandProvider {
+
+	public static final String SYMBIAN_ABLD_SPEC = "symbian-abld"; 
+	public static final String SYMBIAN_SBSV2_SPEC = "symbian-sbsv2"; 
+	
+	public List<String> getAdditionalArgs(IProject project) {
+		
+		// Do nothing....
+		return null;
+	}
+
+	public String getProviderMkspec(IProject project) {
+		if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(project)){
+			return SYMBIAN_SBSV2_SPEC;
+		} else if (CarbideBuilderPlugin.getBuildManager().isCarbideProject(project)) {
+			return SYMBIAN_ABLD_SPEC;
+		}
+		
+		// Project may just be being created so check the project session properties
+		boolean sbsv2Project = false;
+		Object property = null;
+		try {
+			property = project.getSessionProperty(CarbideBuilderPlugin.SBSV2_PROJECT);
+			//project.setSessionProperty(key, value)
+		} catch (CoreException e) {
+			e.printStackTrace();
+		}
+		if (property != null && property instanceof Boolean) {
+			sbsv2Project = ((Boolean)property).booleanValue();
+		}
+		
+		if (sbsv2Project){
+			return SYMBIAN_SBSV2_SPEC;
+		} else {
+			return SYMBIAN_ABLD_SPEC;
+		}
+		
+	}
+
+}
--- a/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/processes/ProjectCreatedTasksQt.java	Wed Feb 24 15:58:49 2010 -0600
+++ b/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/processes/ProjectCreatedTasksQt.java	Thu Feb 25 10:20:24 2010 -0600
@@ -31,6 +31,7 @@
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
 import com.nokia.carbide.cpp.internal.qt.core.QtCorePlugin;
 import com.nokia.carbide.cpp.internal.qt.core.QtSDKUtils;
 import com.nokia.carbide.cpp.internal.qt.ui.QtUIPlugin;
@@ -60,7 +61,7 @@
 		if (project != null) {
 			// add qt nature here
 			QtCorePlugin.addQtNature(project, monitor);
-
+			
 			// enable the pro file listener by default
 			new QtProject(project).setRunQMakeWhenProFileChanges(true);
 
@@ -83,6 +84,9 @@
 			Map<String, String> envMods = new HashMap<String, String>();
 			envMods.put("EPOCROOT", epocroot.setDevice(null).toOSString());
 			
+			// Make sure we set the session property so when qmake is called we know the proper -spec to invoke
+			project.setSessionProperty(CarbideBuilderPlugin.SBSV2_PROJECT, Boolean.valueOf(useSBSv2Builder));
+			
 			// run qmake to ensure bld.inf file exists
 			String errMsg = QMakeRunner.runQMake(project, envMods, monitor);
 			if (errMsg != null) {