Support QML preview with qmlproject on android

Change-Id: I53a074d2064ddd2a20e745250d9620cd1969928b
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
Ulf Hermann
2018-01-30 18:41:56 +01:00
parent b4a1798618
commit 8b867e88f4
2 changed files with 17 additions and 0 deletions

View File

@@ -47,6 +47,8 @@ AndroidDevice::AndroidDevice()
{
setDisplayName(QCoreApplication::translate("Android::Internal::AndroidDevice", "Run on Android"));
setDeviceState(DeviceReadyToUse);
setQmlsceneCommand(
"org.qtproject.example.qmlscene/org.qtproject.qt5.android.bindings.QtActivity");
}
AndroidDevice::AndroidDevice(const AndroidDevice &other)

View File

@@ -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);