forked from qt-creator/qt-creator
Support QML preview with qmlproject on android
Change-Id: I53a074d2064ddd2a20e745250d9620cd1969928b Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user