aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/android/androidplugin.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-01-30 18:41:56 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-02-14 14:03:33 +0000
commit8b867e88f47d8336ca5a961cca69ae1bade0f894 (patch)
treeeaf71b430e9140783f8113f5935cd97ecb3bfbb8 /src/plugins/android/androidplugin.cpp
parentb4a17986187930ee73e2b1cb1e476762b7aa2a56 (diff)
Support QML preview with qmlproject on android
Change-Id: I53a074d2064ddd2a20e745250d9620cd1969928b Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Diffstat (limited to 'src/plugins/android/androidplugin.cpp')
-rw-r--r--src/plugins/android/androidplugin.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp
index a52e67292de..c9360527fb4 100644
--- a/src/plugins/android/androidplugin.cpp
+++ b/src/plugins/android/androidplugin.cpp
@@ -50,7 +50,9 @@
#endif
#include <projectexplorer/devicesupport/devicemanager.h>
+#include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitmanager.h>
+#include <projectexplorer/target.h>
#include <qtsupport/qtversionmanager.h>
@@ -93,6 +95,19 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa
RunControl::registerWorker<AndroidRunConfiguration, AndroidQmlToolingSupport>(
QML_PREVIEW_RUN_MODE);
+ RunControl::registerWorker(QML_PREVIEW_RUN_MODE, [](RunControl *runControl) -> RunWorker* {
+ const Runnable runnable = runControl->runConfiguration()->runnable();
+ QTC_ASSERT(runnable.is<StandardRunnable>(), return nullptr);
+ const StandardRunnable standardRunnable = runnable.as<StandardRunnable>();
+ return new AndroidQmlToolingSupport(runControl, standardRunnable.executable,
+ standardRunnable.commandLineArguments);
+ }, [](RunConfiguration *runConfig) {
+ return runConfig->isEnabled()
+ && runConfig->id().name().startsWith("QmlProjectManager.QmlRunConfiguration")
+ && DeviceTypeKitInformation::deviceTypeId(runConfig->target()->kit())
+ == Android::Constants::ANDROID_DEVICE_TYPE;
+ });
+
d = new AndroidPluginPrivate;
KitManager::registerKitInformation(new Internal::AndroidGdbServerKitInformation);