summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-02-20 17:18:20 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-02-25 11:46:54 +0100
commit06ed0718c56f5f8c65722b2b2ad1eb54815ab4ed (patch)
tree2c5ce76e3e6c8368807f31cde5987b4337ad87b0 /src/plugins
parent7695df58ea8d90deb6daab1326ab652610a59d58 (diff)
downloadqt-creator-06ed0718c56f5f8c65722b2b2ad1eb54815ab4ed.tar.gz
Long live the Windows RT plugin!
Done-with: Andrew Knight <andrew.knight@digia.com> Done-with: Friedemann Kleint <friedemann.kleint@digia.com> Change-Id: I4772938e775056d6a36a7e75f868921a74007862 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/plugins.pro4
-rw-r--r--src/plugins/plugins.qbs3
-rw-r--r--src/plugins/qtsupport/qtsupportconstants.h4
-rw-r--r--src/plugins/winrt/WinRt.pluginspec.in18
-rw-r--r--src/plugins/winrt/winrt.pro35
-rw-r--r--src/plugins/winrt/winrt.qbs42
-rw-r--r--src/plugins/winrt/winrt_dependencies.pri5
-rw-r--r--src/plugins/winrt/winrtconstants.h49
-rw-r--r--src/plugins/winrt/winrtdeployconfiguration.cpp213
-rw-r--r--src/plugins/winrt/winrtdeployconfiguration.h80
-rw-r--r--src/plugins/winrt/winrtdevice.cpp125
-rw-r--r--src/plugins/winrt/winrtdevice.h78
-rw-r--r--src/plugins/winrt/winrtdevicefactory.cpp246
-rw-r--r--src/plugins/winrt/winrtdevicefactory.h69
-rw-r--r--src/plugins/winrt/winrtpackagedeploymentstep.cpp87
-rw-r--r--src/plugins/winrt/winrtpackagedeploymentstep.h50
-rw-r--r--src/plugins/winrt/winrtphoneqtversion.cpp75
-rw-r--r--src/plugins/winrt/winrtphoneqtversion.h56
-rw-r--r--src/plugins/winrt/winrtplugin.cpp84
-rw-r--r--src/plugins/winrt/winrtplugin.h55
-rw-r--r--src/plugins/winrt/winrtqtversion.cpp88
-rw-r--r--src/plugins/winrt/winrtqtversion.h58
-rw-r--r--src/plugins/winrt/winrtqtversionfactory.cpp96
-rw-r--r--src/plugins/winrt/winrtqtversionfactory.h55
-rw-r--r--src/plugins/winrt/winrtrunconfiguration.cpp87
-rw-r--r--src/plugins/winrt/winrtrunconfiguration.h69
-rw-r--r--src/plugins/winrt/winrtrunconfigurationwidget.cpp70
-rw-r--r--src/plugins/winrt/winrtrunconfigurationwidget.h67
-rw-r--r--src/plugins/winrt/winrtrunconfigurationwidget.ui39
-rw-r--r--src/plugins/winrt/winrtruncontrol.cpp209
-rw-r--r--src/plugins/winrt/winrtruncontrol.h87
-rw-r--r--src/plugins/winrt/winrtrunfactories.cpp153
-rw-r--r--src/plugins/winrt/winrtrunfactories.h74
33 files changed, 2529 insertions, 1 deletions
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 987cb24b3a..c910d6be58 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -51,6 +51,10 @@ SUBDIRS = \
ios \
beautifier
+minQtVersion(5, 0, 0) {
+ SUBDIRS += winrt
+}
+
# prefer qmake variable set on command line over env var
isEmpty(LLVM_INSTALL_DIR):LLVM_INSTALL_DIR=$$(LLVM_INSTALL_DIR)
!isEmpty(LLVM_INSTALL_DIR) {
diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs
index 7f621efd7a..5611d5675d 100644
--- a/src/plugins/plugins.qbs
+++ b/src/plugins/plugins.qbs
@@ -60,6 +60,7 @@ Project {
"updateinfo/updateinfo.qbs",
"valgrind/valgrind.qbs",
"vcsbase/vcsbase.qbs",
- "welcome/welcome.qbs"
+ "welcome/welcome.qbs",
+ "winrt/winrt.qbs"
].concat(project.additionalPlugins)
}
diff --git a/src/plugins/qtsupport/qtsupportconstants.h b/src/plugins/qtsupport/qtsupportconstants.h
index 5da14ecea9..93d9c4fc2c 100644
--- a/src/plugins/qtsupport/qtsupportconstants.h
+++ b/src/plugins/qtsupport/qtsupportconstants.h
@@ -70,12 +70,16 @@ const char FEATURE_DESKTOP[] = "QtSupport.Wizards.FeatureDesktop";
const char DESKTOP_PLATFORM[] = "Desktop";
const char EMBEDDED_LINUX_PLATFORM[] = "Embedded Linux";
const char WINDOWS_CE_PLATFORM[] = "Windows CE";
+const char WINDOWS_RT_PLATFORM[] = "Windows Runtime";
+const char WINDOWS_PHONE_PLATFORM[] = "Windows Phone";
const char ANDROID_PLATFORM[] = "Android";
const char IOS_PLATFORM[] = "iOS";
const char DESKTOP_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Desktop");
const char EMBEDDED_LINUX_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Embedded Linux");
const char WINDOWS_CE_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Windows CE");
+const char WINDOWS_RT_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Windows Runtime");
+const char WINDOWS_PHONE_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Windows Phone");
const char ANDROID_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Android");
const char IOS_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "iOS");
diff --git a/src/plugins/winrt/WinRt.pluginspec.in b/src/plugins/winrt/WinRt.pluginspec.in
new file mode 100644
index 0000000000..447a788ac2
--- /dev/null
+++ b/src/plugins/winrt/WinRt.pluginspec.in
@@ -0,0 +1,18 @@
+<plugin name=\"WinRt\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\" experimental=\"true\">
+ <platform>Windows 8</platform>
+ <vendor>Digia Plc</vendor>
+ <copyright>(C) 2014 Digia Plc</copyright>
+ <license>
+Commercial Usage
+
+Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Digia.
+
+GNU Lesser General Public License Usage
+
+Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ </license>
+ <category>Device Support</category>
+ <description>Helper for Windows Runtime projects</description>
+ <url>http://www.qt-project.org</url>
+ $$dependencyList
+</plugin>
diff --git a/src/plugins/winrt/winrt.pro b/src/plugins/winrt/winrt.pro
new file mode 100644
index 0000000000..85c18c7c06
--- /dev/null
+++ b/src/plugins/winrt/winrt.pro
@@ -0,0 +1,35 @@
+include(../../qtcreatorplugin.pri)
+
+HEADERS += \
+ winrtconstants.h \
+ winrtdeployconfiguration.h \
+ winrtdevice.h \
+ winrtdevicefactory.h \
+ winrtpackagedeploymentstep.h \
+ winrtphoneqtversion.h \
+ winrtplugin.h \
+ winrtqtversion.h \
+ winrtqtversionfactory.h \
+ winrtrunconfiguration.h \
+ winrtrunconfigurationwidget.h \
+ winrtruncontrol.h \
+ winrtrunfactories.h
+
+SOURCES += \
+ winrtdeployconfiguration.cpp \
+ winrtdevice.cpp \
+ winrtdevicefactory.cpp \
+ winrtpackagedeploymentstep.cpp \
+ winrtphoneqtversion.cpp \
+ winrtplugin.cpp \
+ winrtqtversion.cpp \
+ winrtqtversionfactory.cpp \
+ winrtrunconfiguration.cpp \
+ winrtrunconfigurationwidget.cpp \
+ winrtruncontrol.cpp \
+ winrtrunfactories.cpp
+
+DEFINES += WINRT_LIBRARY
+
+FORMS += \
+ winrtrunconfigurationwidget.ui
diff --git a/src/plugins/winrt/winrt.qbs b/src/plugins/winrt/winrt.qbs
new file mode 100644
index 0000000000..e035b11232
--- /dev/null
+++ b/src/plugins/winrt/winrt.qbs
@@ -0,0 +1,42 @@
+import qbs.base 1.0
+
+import QtcPlugin
+
+QtcPlugin {
+ name: "WinRt"
+ minimumQtVersion: "5.0"
+
+ Depends { name: "Core" }
+ Depends { name: "ProjectExplorer" }
+ Depends { name: "QtSupport" }
+ Depends { name: "Qt.gui" }
+
+ files: [
+ "winrtconstants.h",
+ "winrtdeployconfiguration.cpp",
+ "winrtdeployconfiguration.h",
+ "winrtdevice.cpp",
+ "winrtdevice.h",
+ "winrtdevicefactory.cpp",
+ "winrtdevicefactory.h",
+ "winrtpackagedeploymentstep.cpp",
+ "winrtpackagedeploymentstep.h",
+ "winrtphoneqtversion.cpp",
+ "winrtphoneqtversion.h",
+ "winrtplugin.cpp",
+ "winrtplugin.h",
+ "winrtqtversion.cpp",
+ "winrtqtversion.h",
+ "winrtqtversionfactory.cpp",
+ "winrtqtversionfactory.h",
+ "winrtrunconfiguration.cpp",
+ "winrtrunconfiguration.h",
+ "winrtrunconfigurationwidget.cpp",
+ "winrtrunconfigurationwidget.h",
+ "winrtrunconfigurationwidget.ui",
+ "winrtruncontrol.cpp",
+ "winrtruncontrol.h",
+ "winrtrunfactories.cpp",
+ "winrtrunfactories.h"
+ ]
+}
diff --git a/src/plugins/winrt/winrt_dependencies.pri b/src/plugins/winrt/winrt_dependencies.pri
new file mode 100644
index 0000000000..43e33249af
--- /dev/null
+++ b/src/plugins/winrt/winrt_dependencies.pri
@@ -0,0 +1,5 @@
+QTC_PLUGIN_NAME = WinRt
+QTC_PLUGIN_DEPENDS += \
+ coreplugin \
+ projectexplorer \
+ qtsupport
diff --git a/src/plugins/winrt/winrtconstants.h b/src/plugins/winrt/winrtconstants.h
new file mode 100644
index 0000000000..a573a4fc6d
--- /dev/null
+++ b/src/plugins/winrt/winrtconstants.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTCONSTANTS_H
+#define WINRTCONSTANTS_H
+
+namespace WinRt {
+namespace Internal {
+namespace Constants {
+const char WINRT_DEVICE_TYPE_LOCAL[] = "WinRt.Device.Local";
+const char WINRT_DEVICE_TYPE_EMULATOR[] = "WinRt.Device.Emulator";
+const char WINRT_DEVICE_TYPE_PHONE[] = "WinRt.Device.Phone";
+const char WINRT_BUILD_STEP_DEPLOY[] = "WinRt.BuildStep.Deploy";
+const char WINRT_WINRTQT[] = "WinRt.QtVersion.WindowsRuntime";
+const char WINRT_WINPHONEQT[] = "WinRt.QtVersion.WindowsPhone";
+const char WINRT_QTMAP_SUBKEYNAME[] = "WinRt";
+const char WINRT_QTMAP_OSFLAVOR[] = "OsFlavor";
+const char WINRT_MANIFEST_EDITOR_ID[] = "WinRTManifestEditorID";
+}
+} // Internal
+} // WinRt
+
+#endif // WINRTCONSTANTS_H
diff --git a/src/plugins/winrt/winrtdeployconfiguration.cpp b/src/plugins/winrt/winrtdeployconfiguration.cpp
new file mode 100644
index 0000000000..9e2cbcacc6
--- /dev/null
+++ b/src/plugins/winrt/winrtdeployconfiguration.cpp
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtdeployconfiguration.h"
+#include "winrtpackagedeploymentstep.h"
+#include "winrtconstants.h"
+
+#include <projectexplorer/project.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <qtsupport/qtkitinformation.h>
+
+using namespace ProjectExplorer;
+
+namespace WinRt {
+namespace Internal {
+
+static const char appxDeployConfigurationC[] = "WinRTAppxDeployConfiguration";
+static const char phoneDeployConfigurationC[] = "WinRTPhoneDeployConfiguration";
+static const char emulatorDeployConfigurationC[] = "WinRTEmulatorDeployConfiguration";
+
+WinRtDeployConfigurationFactory::WinRtDeployConfigurationFactory(QObject *parent)
+ : DeployConfigurationFactory(parent)
+{
+}
+
+QString WinRtDeployConfigurationFactory::displayNameForId(const Core::Id id) const
+{
+ if (id == appxDeployConfigurationC)
+ return tr("Deploy locally");
+ if (id == phoneDeployConfigurationC)
+ return tr("Deploy to Windows Phone");
+ if (id == emulatorDeployConfigurationC)
+ return tr("Deploy to Windows Phone Emulator");
+ return QString();
+}
+
+QList<Core::Id> WinRtDeployConfigurationFactory::availableCreationIds(Target *parent) const
+{
+ if (!parent->project()->supportsKit(parent->kit()))
+ return QList<Core::Id>();
+
+ IDevice::ConstPtr device = DeviceKitInformation::device(parent->kit());
+ if (!device)
+ return QList<Core::Id>();
+
+ if (device->type() == Constants::WINRT_DEVICE_TYPE_LOCAL)
+ return QList<Core::Id>() << Core::Id(appxDeployConfigurationC);
+
+ if (device->type() == Constants::WINRT_DEVICE_TYPE_PHONE)
+ return QList<Core::Id>() << Core::Id(phoneDeployConfigurationC);
+
+ if (device->type() == Constants::WINRT_DEVICE_TYPE_EMULATOR)
+ return QList<Core::Id>() << Core::Id(emulatorDeployConfigurationC);
+
+ return QList<Core::Id>();
+}
+
+bool WinRtDeployConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
+{
+ return availableCreationIds(parent).contains(id);
+}
+
+DeployConfiguration *WinRtDeployConfigurationFactory::create(Target *parent, const Core::Id id)
+{
+ if (id == appxDeployConfigurationC
+ || id == phoneDeployConfigurationC
+ || id == emulatorDeployConfigurationC) {
+ return new WinRtDeployConfiguration(parent, id);
+ }
+ return 0;
+}
+
+bool WinRtDeployConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
+{
+ return canCreate(parent, idFromMap(map));
+}
+
+DeployConfiguration *WinRtDeployConfigurationFactory::restore(Target *parent,
+ const QVariantMap &map)
+{
+ WinRtDeployConfiguration *dc = new WinRtDeployConfiguration(parent, idFromMap(map));
+ if (!dc->fromMap(map)) {
+ delete dc;
+ return 0;
+ }
+ return dc;
+}
+
+bool WinRtDeployConfigurationFactory::canClone(Target *parent, DeployConfiguration *source) const
+{
+ return availableCreationIds(parent).contains(source->id());
+}
+
+DeployConfiguration *WinRtDeployConfigurationFactory::clone(Target *parent,
+ DeployConfiguration *source)
+{
+ if (source->id() == appxDeployConfigurationC
+ || source->id() == phoneDeployConfigurationC
+ || source->id() == emulatorDeployConfigurationC) {
+ return new WinRtDeployConfiguration(parent, source);
+ }
+ return 0;
+}
+
+QList<Core::Id> WinRtDeployStepFactory::availableCreationIds(BuildStepList *parent) const
+{
+ QList<Core::Id> ids;
+ if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
+ return ids;
+ if (!parent->target()->project()->supportsKit(parent->target()->kit()))
+ return ids;
+ if (!parent->contains(Constants::WINRT_BUILD_STEP_DEPLOY))
+ ids << Constants::WINRT_BUILD_STEP_DEPLOY;
+ return ids;
+}
+
+QString WinRtDeployStepFactory::displayNameForId(const Core::Id id) const
+{
+ if (id == Constants::WINRT_BUILD_STEP_DEPLOY)
+ return tr("Deploy Qt binaries and application files");
+ return QString();
+}
+
+bool WinRtDeployStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
+{
+ return availableCreationIds(parent).contains(id);
+}
+
+BuildStep *WinRtDeployStepFactory::create(BuildStepList *parent, const Core::Id id)
+{
+ if (id == Constants::WINRT_BUILD_STEP_DEPLOY)
+ return new WinRtPackageDeploymentStep(parent);
+ return 0;
+}
+
+bool WinRtDeployStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
+{
+ return canCreate(parent, idFromMap(map));
+}
+
+BuildStep *WinRtDeployStepFactory::restore(BuildStepList *parent, const QVariantMap &map)
+{
+ BuildStep *bs = create(parent, idFromMap(map));
+ if (!bs->fromMap(map)) {
+ delete bs;
+ bs = 0;
+ }
+ return bs;
+}
+
+bool WinRtDeployStepFactory::canClone(BuildStepList *parent, BuildStep *source) const
+{
+ Q_UNUSED(parent);
+ Q_UNUSED(source);
+ return false;
+}
+
+BuildStep *WinRtDeployStepFactory::clone(BuildStepList *parent, BuildStep *source)
+{
+ Q_UNUSED(parent);
+ Q_UNUSED(source);
+ return 0;
+}
+
+WinRtDeployConfiguration::WinRtDeployConfiguration(Target *target, Core::Id id)
+ : DeployConfiguration(target, id)
+{
+ if (id == appxDeployConfigurationC)
+ setDefaultDisplayName(tr("Deploy locally"));
+ if (id == phoneDeployConfigurationC)
+ setDefaultDisplayName(tr("Deploy to Windows Phone Device"));
+ if (id == emulatorDeployConfigurationC)
+ setDefaultDisplayName(tr("Deploy to Windows Phone Emulator"));
+
+ stepList()->insertStep(0, new WinRtPackageDeploymentStep(stepList()));
+}
+
+WinRtDeployConfiguration::WinRtDeployConfiguration(Target *target, DeployConfiguration *source)
+ : DeployConfiguration(target, source)
+{
+ cloneSteps(source);
+}
+
+} // namespace Internal
+} // namespace WinRt
diff --git a/src/plugins/winrt/winrtdeployconfiguration.h b/src/plugins/winrt/winrtdeployconfiguration.h
new file mode 100644
index 0000000000..fbc6d19cb4
--- /dev/null
+++ b/src/plugins/winrt/winrtdeployconfiguration.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTDEPLOYCONFIGURATION_H
+#define WINRTDEPLOYCONFIGURATION_H
+
+#include <projectexplorer/deployconfiguration.h>
+#include <projectexplorer/buildstep.h>
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory
+{
+public:
+ explicit WinRtDeployConfigurationFactory(QObject *parent = 0);
+ QString displayNameForId(const Core::Id id) const;
+ QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
+ bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
+ ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
+ bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
+ ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
+ bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const;
+ ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent,
+ ProjectExplorer::DeployConfiguration *source);
+};
+
+class WinRtDeployStepFactory : public ProjectExplorer::IBuildStepFactory
+{
+public:
+ QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+ bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
+ ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
+ bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
+ ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
+ bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
+ ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *source);
+};
+
+class WinRtDeployConfiguration : public ProjectExplorer::DeployConfiguration
+{
+private:
+ friend class WinRtDeployConfigurationFactory;
+ explicit WinRtDeployConfiguration(ProjectExplorer::Target *target, Core::Id id);
+ explicit WinRtDeployConfiguration(ProjectExplorer::Target *target,
+ ProjectExplorer::DeployConfiguration *source);
+};
+
+} // namespace Internal
+} // namespace WinRt
+
+#endif // WINRTDEPLOYCONFIGURATION_H
diff --git a/src/plugins/winrt/winrtdevice.cpp b/src/plugins/winrt/winrtdevice.cpp
new file mode 100644
index 0000000000..b919c18102
--- /dev/null
+++ b/src/plugins/winrt/winrtdevice.cpp
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtdevice.h"
+#include "winrtconstants.h"
+
+#include <projectexplorer/devicesupport/devicemanager.h>
+#include <projectexplorer/devicesupport/deviceprocesslist.h>
+#include <utils/qtcassert.h>
+
+#include <QFileInfo>
+#include <QCoreApplication>
+#include <QWizard>
+
+using namespace ProjectExplorer;
+
+namespace WinRt {
+namespace Internal {
+
+WinRtDevice::WinRtDevice()
+{
+}
+
+WinRtDevice::WinRtDevice(Core::Id type, MachineType machineType, Core::Id internalId, int deviceId)
+ : IDevice(type, AutoDetected, machineType, internalId), m_deviceId(deviceId)
+{
+}
+
+WinRtDevice::WinRtDevice(const WinRtDevice &other)
+ : IDevice(other), m_deviceId(other.m_deviceId)
+{
+}
+
+QString WinRtDevice::displayType() const
+{
+ return displayNameForType(type());
+}
+
+IDeviceWidget *WinRtDevice::createWidget()
+{
+ return 0;
+}
+
+QList<Core::Id> WinRtDevice::actionIds() const
+{
+ return QList<Core::Id>();
+}
+
+QString WinRtDevice::displayNameForActionId(Core::Id actionId) const
+{
+ Q_UNUSED(actionId);
+ return QString();
+}
+
+void WinRtDevice::executeAction(Core::Id actionId, QWidget *parent)
+{
+ Q_UNUSED(actionId);
+ Q_UNUSED(parent);
+}
+
+ProjectExplorer::DeviceProcessSignalOperation::Ptr WinRtDevice::signalOperation() const
+{
+ return DeviceProcessSignalOperation::Ptr();
+}
+
+void WinRtDevice::fromMap(const QVariantMap &map)
+{
+ IDevice::fromMap(map);
+ m_deviceId = map.value(QStringLiteral("WinRtRunnerDeviceId")).toInt();
+}
+
+QVariantMap WinRtDevice::toMap() const
+{
+ QVariantMap map = IDevice::toMap();
+ map.insert(QStringLiteral("WinRtRunnerDeviceId"), m_deviceId);
+ return map;
+}
+
+IDevice::Ptr WinRtDevice::clone() const
+{
+ return IDevice::Ptr(new WinRtDevice(*this));
+}
+
+QString WinRtDevice::displayNameForType(Core::Id type)
+{
+ if (type == Constants::WINRT_DEVICE_TYPE_LOCAL)
+ return QCoreApplication::translate("WinRt::Internal::WinRtDevice",
+ "Windows Runtime (Local)");
+ if (type == Constants::WINRT_DEVICE_TYPE_PHONE)
+ return QCoreApplication::translate("WinRt::Internal::WinRtDevice",
+ "Windows Phone");
+ if (type == Constants::WINRT_DEVICE_TYPE_EMULATOR)
+ return QCoreApplication::translate("WinRt::Internal::WinRtDevice",
+ "Windows Phone Emulator");
+ return QString();
+}
+
+} // Internal
+} // WinRt
diff --git a/src/plugins/winrt/winrtdevice.h b/src/plugins/winrt/winrtdevice.h
new file mode 100644
index 0000000000..dc8eb518e3
--- /dev/null
+++ b/src/plugins/winrt/winrtdevice.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTDEVICE_H
+#define WINRTDEVICE_H
+
+#include <QList>
+#include <QUuid>
+#include <QSharedPointer>
+
+#include <projectexplorer/devicesupport/idevice.h>
+
+namespace Debugger {
+ class DebuggerStartParameters;
+} // Debugger
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtDevice : public ProjectExplorer::IDevice
+{
+ friend class WinRtDeviceFactory;
+public:
+ typedef QSharedPointer<WinRtDevice> Ptr;
+ typedef QSharedPointer<const WinRtDevice> ConstPtr;
+
+ QString displayType() const;
+ ProjectExplorer::IDeviceWidget *createWidget();
+ QList<Core::Id> actionIds() const;
+ QString displayNameForActionId(Core::Id actionId) const;
+ void executeAction(Core::Id actionId, QWidget *parent);
+ ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const;
+ void fromMap(const QVariantMap &map);
+ QVariantMap toMap() const;
+ ProjectExplorer::IDevice::Ptr clone() const;
+
+ static QString displayNameForType(Core::Id type);
+ int deviceId() const { return m_deviceId; }
+
+protected:
+ WinRtDevice();
+ WinRtDevice(Core::Id type, MachineType machineType, Core::Id internalId, int deviceId);
+ WinRtDevice(const WinRtDevice &other);
+
+private:
+ int m_deviceId;
+};
+
+} // Internal
+} // WinRt
+
+#endif // WINRTDEVICE_H
diff --git a/src/plugins/winrt/winrtdevicefactory.cpp b/src/plugins/winrt/winrtdevicefactory.cpp
new file mode 100644
index 0000000000..08231298ba
--- /dev/null
+++ b/src/plugins/winrt/winrtdevicefactory.cpp
@@ -0,0 +1,246 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtdevicefactory.h"
+
+#include "winrtconstants.h"
+#include "winrtdevice.h"
+#include "winrtqtversion.h"
+
+#include <coreplugin/messagemanager.h>
+#include <projectexplorer/devicesupport/devicemanager.h>
+#include <qtsupport/qtversionmanager.h>
+#include <utils/qtcassert.h>
+
+#include <QFileInfo>
+
+using Core::MessageManager;
+using ProjectExplorer::DeviceManager;
+using ProjectExplorer::IDevice;
+using QtSupport::BaseQtVersion;
+using QtSupport::QtVersionManager;
+
+namespace WinRt {
+namespace Internal {
+
+WinRtDeviceFactory::WinRtDeviceFactory()
+ : m_process(0)
+{
+}
+
+QString WinRtDeviceFactory::displayNameForId(Core::Id type) const
+{
+ return WinRtDevice::displayNameForType(type);
+}
+
+QList<Core::Id> WinRtDeviceFactory::availableCreationIds() const
+{
+ return QList<Core::Id>() << Constants::WINRT_DEVICE_TYPE_LOCAL
+ << Constants::WINRT_DEVICE_TYPE_PHONE
+ << Constants::WINRT_DEVICE_TYPE_EMULATOR;
+}
+
+IDevice::Ptr WinRtDeviceFactory::create(Core::Id id) const
+{
+ Q_UNUSED(id);
+ QTC_CHECK(false);
+ return IDevice::Ptr();
+}
+
+bool WinRtDeviceFactory::canRestore(const QVariantMap &map) const
+{
+ return availableCreationIds().contains(IDevice::typeFromMap(map));
+}
+
+IDevice::Ptr WinRtDeviceFactory::restore(const QVariantMap &map) const
+{
+ const IDevice::Ptr device(new WinRtDevice);
+ device->fromMap(map);
+ return device;
+}
+
+void WinRtDeviceFactory::autoDetect()
+{
+ MessageManager::write(tr("Running Windows Runtime device detection."));
+ const QString runnerFilePath = findRunnerFilePath();
+ if (runnerFilePath.isEmpty()) {
+ MessageManager::write(tr("No winrtrunner.exe found."));
+ return;
+ }
+
+ if (!m_process) {
+ m_process = new Utils::QtcProcess(this);
+ connect(m_process, SIGNAL(error(QProcess::ProcessError)), SLOT(onProcessError()));
+ connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)),
+ SLOT(onProcessFinished(int,QProcess::ExitStatus)));
+ }
+
+ const QString args = QStringLiteral("--list-devices");
+ m_process->setCommand(runnerFilePath, args);
+ MessageManager::write(runnerFilePath + QLatin1Char(' ') + args);
+ m_process->start();
+}
+
+void WinRtDeviceFactory::onDevicesLoaded()
+{
+ autoDetect();
+ connect(QtSupport::QtVersionManager::instance(),
+ SIGNAL(qtVersionsChanged(const QList<int>&, const QList<int>&,
+ const QList<int>&)),
+ SLOT(autoDetect()));
+}
+
+void WinRtDeviceFactory::onProcessError()
+{
+ MessageManager::write(tr("Error while executing winrtrunner: %1")
+ .arg(m_process->errorString()), MessageManager::Flash);
+}
+
+void WinRtDeviceFactory::onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
+{
+ if (exitStatus == QProcess::CrashExit) {
+ // already handled in onProcessError
+ return;
+ }
+
+ if (exitCode != 0) {
+ MessageManager::write(tr("winrtrunner.exe returned with exit code %1.")
+ .arg(exitCode), MessageManager::Flash);
+ return;
+ }
+
+ parseRunnerOutput(m_process->readAllStandardOutput());
+}
+
+QString WinRtDeviceFactory::findRunnerFilePath() const
+{
+ const QString winRtQtType = QLatin1String(Constants::WINRT_WINRTQT);
+ const QString winPhoneQtType = QLatin1String(Constants::WINRT_WINPHONEQT);
+ const QString winRtRunnerExe = QStringLiteral("/winrtrunner.exe");
+ QString filePath;
+ BaseQtVersion *qt = 0;
+ foreach (BaseQtVersion *v, QtVersionManager::versions()) {
+ if (!v->isValid() || (v->type() != winRtQtType && v->type() != winPhoneQtType))
+ continue;
+ if (!qt || qt->qtVersion() < v->qtVersion()) {
+ QFileInfo fi(v->binPath().toString() + winRtRunnerExe);
+ if (fi.isFile() && fi.isExecutable()) {
+ qt = v;
+ filePath = fi.absoluteFilePath();
+ }
+ }
+ }
+ return filePath;
+}
+
+static int extractDeviceId(QByteArray *line)
+{
+ int pos = line->indexOf(' ');
+ if (pos < 0)
+ return -1;
+ bool ok;
+ int id = line->left(pos).toInt(&ok);
+ if (!ok)
+ return -1;
+ line->remove(0, pos + 1);
+ return id;
+}
+
+static IDevice::MachineType machineTypeFromLine(const QByteArray &line)
+{
+ return line.startsWith("Emulator ") ? IDevice::Emulator : IDevice::Hardware;
+}
+
+/*
+ * The output of "winrtrunner --list-devices" looks like this:
+ *
+ * Available devices:
+ * Appx:
+ * 0 local
+ * Xap:
+ * 0 Device
+ * 1 Emulator WVGA 512MB
+ * 2 Emulator WVGA
+ * 3 Emulator WXGA
+ * 4 Emulator 720P
+ */
+void WinRtDeviceFactory::parseRunnerOutput(const QByteArray &output) const
+{
+ ProjectExplorer::DeviceManager *deviceManager = ProjectExplorer::DeviceManager::instance();
+ enum State { StartState, AppxState, XapState };
+ State state = StartState;
+ int numFound = 0;
+ int numSkipped = 0;
+ foreach (QByteArray line, output.split('\n')) {
+ line = line.trimmed();
+ if (line == "Appx:") {
+ state = AppxState;
+ } else if (line == "Xap:") {
+ state = XapState;
+ } else {
+ const int deviceId = extractDeviceId(&line);
+ if (deviceId < 0)
+ continue;
+
+ const IDevice::MachineType machineType = machineTypeFromLine(line);
+ Core::Id deviceType;
+ QString name;
+ QString internalName = QStringLiteral("WinRT.");
+ if (state == AppxState) {
+ internalName += QStringLiteral("appx.");
+ deviceType = Constants::WINRT_DEVICE_TYPE_LOCAL;
+ name = tr("Windows Runtime local UI");
+ } else if (state == XapState) {
+ internalName += QStringLiteral("xap.");
+ name = QString::fromLocal8Bit(line);
+ if (machineType == IDevice::Emulator)
+ deviceType = Constants::WINRT_DEVICE_TYPE_EMULATOR;
+ else
+ deviceType = Constants::WINRT_DEVICE_TYPE_PHONE;
+ }
+ internalName += QString::number(deviceId);
+ const Core::Id internalId = Core::Id::fromString(internalName);
+ ++numFound;
+ if (DeviceManager::instance()->find(internalId)) {
+ ++numSkipped;
+ continue;
+ }
+
+ WinRtDevice *device = new WinRtDevice(deviceType, machineType,
+ internalId, deviceId);
+ device->setDisplayName(name);
+ deviceManager->addDevice(ProjectExplorer::IDevice::ConstPtr(device));
+ }
+ }
+ MessageManager::write(tr("Found %1 Windows Runtime devices. %2 of them are new.").arg(numFound)
+ .arg(numFound - numSkipped));
+}
+
+} // Internal
+} // WinRt
diff --git a/src/plugins/winrt/winrtdevicefactory.h b/src/plugins/winrt/winrtdevicefactory.h
new file mode 100644
index 0000000000..e91b8bdbfe
--- /dev/null
+++ b/src/plugins/winrt/winrtdevicefactory.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTDEVICEFACTORY_H
+#define WINRTDEVICEFACTORY_H
+
+#include <projectexplorer/devicesupport/idevicefactory.h>
+#include <utils/qtcprocess.h>
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtDeviceFactory : public ProjectExplorer::IDeviceFactory
+{
+ Q_OBJECT
+public:
+ WinRtDeviceFactory();
+ QString displayNameForId(Core::Id type) const;
+ QList<Core::Id> availableCreationIds() const;
+ bool canCreate() const { return false; }
+ ProjectExplorer::IDevice::Ptr create(Core::Id id) const;
+ bool canRestore(const QVariantMap &map) const;
+ ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const;
+
+public slots:
+ void autoDetect();
+ void onDevicesLoaded();
+
+private slots:
+ void onProcessError();
+ void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
+
+private:
+ QString findRunnerFilePath() const;
+ void parseRunnerOutput(const QByteArray &output) const;
+
+ Utils::QtcProcess *m_process;
+};
+
+} // Internal
+} // WinRt
+
+#endif // WINRTDEVICEFACTORY_H
diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.cpp b/src/plugins/winrt/winrtpackagedeploymentstep.cpp
new file mode 100644
index 0000000000..393903e83a
--- /dev/null
+++ b/src/plugins/winrt/winrtpackagedeploymentstep.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtpackagedeploymentstep.h"
+#include "winrtdevice.h"
+#include "winrtconstants.h"
+
+#include <projectexplorer/project.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/deploymentdata.h>
+#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/buildtargetinfo.h>
+#include <projectexplorer/ioutputparser.h>
+#include <projectexplorer/kitinformation.h>
+#include <coreplugin/idocument.h>
+#include <utils/fileutils.h>
+#include <qtsupport/profilereader.h>
+#include <proparser/qmakevfs.h>
+#include <utils/hostosinfo.h>
+
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <QJsonArray>
+#include <QRegularExpression>
+#include <QRegularExpressionMatchIterator>
+
+using namespace ProjectExplorer;
+
+namespace WinRt {
+namespace Internal {
+
+WinRtPackageDeploymentStep::WinRtPackageDeploymentStep(BuildStepList *bsl)
+ : AbstractProcessStep(bsl, Constants::WINRT_BUILD_STEP_DEPLOY)
+{
+ setDisplayName(tr("Deploy Qt binaries and application files to output directory"));
+}
+
+bool WinRtPackageDeploymentStep::init()
+{
+ Utils::FileName proFile = Utils::FileName::fromString(project()->document()->filePath());
+ const QString targetPath
+ = target()->applicationTargets().targetForProject(proFile).toString()
+ + QLatin1String(".exe");
+ // ### Actually, targetForProject is supposed to return the file path including the file
+ // extension. Whenever this will eventually work, we have to remove the .exe suffix here.
+
+ ProcessParameters *params = processParameters();
+ params->setCommand(QLatin1String("windeployqt.exe"));
+ params->setArguments(QDir::toNativeSeparators(targetPath));
+ params->setEnvironment(target()->activeBuildConfiguration()->environment());
+
+ return AbstractProcessStep::init();
+}
+
+BuildStepConfigWidget *WinRtPackageDeploymentStep::createConfigWidget()
+{
+ return new SimpleBuildStepConfigWidget(this);
+}
+
+} // namespace Internal
+} // namespace WinRt
diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.h b/src/plugins/winrt/winrtpackagedeploymentstep.h
new file mode 100644
index 0000000000..8d51f741fa
--- /dev/null
+++ b/src/plugins/winrt/winrtpackagedeploymentstep.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTPACKAGEDEPLOYMENTSTEP_H
+#define WINRTPACKAGEDEPLOYMENTSTEP_H
+
+#include <projectexplorer/abstractprocessstep.h>
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtPackageDeploymentStep : public ProjectExplorer::AbstractProcessStep
+{
+ Q_OBJECT
+public:
+ explicit WinRtPackageDeploymentStep(ProjectExplorer::BuildStepList *bsl);
+ bool init();
+ ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
+};
+
+} // namespace Internal
+} // namespace WinRt
+
+#endif // WINRTPACKAGEDEPLOYMENTSTEP_H
diff --git a/src/plugins/winrt/winrtphoneqtversion.cpp b/src/plugins/winrt/winrtphoneqtversion.cpp
new file mode 100644
index 0000000000..fc5832f522
--- /dev/null
+++ b/src/plugins/winrt/winrtphoneqtversion.cpp
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtphoneqtversion.h"
+
+#include "winrtconstants.h"
+#include <qtsupport/qtsupportconstants.h>
+
+namespace WinRt {
+namespace Internal {
+
+WinRtPhoneQtVersion::WinRtPhoneQtVersion()
+ : WinRtQtVersion()
+{
+}
+
+WinRtPhoneQtVersion::WinRtPhoneQtVersion(const Utils::FileName &path, bool isAutodetected,
+ const QString &autodetectionSource)
+ : WinRtQtVersion(path, isAutodetected, autodetectionSource)
+{
+}
+
+QString WinRtPhoneQtVersion::description() const
+{
+ return tr("Windows Phone");
+}
+
+QtSupport::BaseQtVersion *WinRtPhoneQtVersion::clone() const
+{
+ return new WinRtPhoneQtVersion(*this);
+}
+
+QString WinRtPhoneQtVersion::type() const
+{
+ return QLatin1String(Constants::WINRT_WINPHONEQT);
+}
+
+QString WinRtPhoneQtVersion::platformName() const
+{
+ return QLatin1String(QtSupport::Constants::WINDOWS_PHONE_PLATFORM);
+}
+
+QString WinRtPhoneQtVersion::platformDisplayName() const
+{
+ return QLatin1String(QtSupport::Constants::WINDOWS_PHONE_PLATFORM_TR);
+}
+
+} // Internal
+} // WinRt
diff --git a/src/plugins/winrt/winrtphoneqtversion.h b/src/plugins/winrt/winrtphoneqtversion.h
new file mode 100644
index 0000000000..9b9164c18b
--- /dev/null
+++ b/src/plugins/winrt/winrtphoneqtversion.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTPHONEQTVERSION_H
+#define WINRTPHONEQTVERSION_H
+
+#include "winrtqtversion.h"
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtPhoneQtVersion : public WinRtQtVersion
+{
+ Q_DECLARE_TR_FUNCTIONS(WinRt::Internal::WinRtQtVersion)
+public:
+ WinRtPhoneQtVersion();
+ WinRtPhoneQtVersion(const Utils::FileName &path, bool isAutodetected,
+ const QString &autodetectionSource);
+
+ QString description() const;
+ BaseQtVersion *clone() const;
+ QString type() const;
+ QString platformName() const;
+ QString platformDisplayName() const;
+};
+
+} // Internal
+} // WinRt
+
+#endif // WINRTPHONEQTVERSION_H
diff --git a/src/plugins/winrt/winrtplugin.cpp b/src/plugins/winrt/winrtplugin.cpp
new file mode 100644
index 0000000000..e067f423b6
--- /dev/null
+++ b/src/plugins/winrt/winrtplugin.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtplugin.h"
+#include "winrtrunfactories.h"
+#include "winrtdevice.h"
+#include "winrtdevicefactory.h"
+#include "winrtdeployconfiguration.h"
+#include "winrtqtversionfactory.h"
+
+#include <coreplugin/icore.h>
+#include <extensionsystem/pluginmanager.h>
+#include <projectexplorer/devicesupport/devicemanager.h>
+
+#include <QtPlugin>
+#include <QSysInfo>
+
+using ExtensionSystem::PluginManager;
+using ProjectExplorer::DeviceManager;
+
+namespace WinRt {
+namespace Internal {
+
+WinRtPlugin::WinRtPlugin()
+{
+ setObjectName(QLatin1String("WinRtPlugin"));
+}
+
+bool WinRtPlugin::initialize(const QStringList &arguments, QString *errorMessage)
+{
+ Q_UNUSED(arguments)
+ Q_UNUSED(errorMessage)
+
+ addAutoReleasedObject(new Internal::WinRtRunConfigurationFactory);
+ addAutoReleasedObject(new Internal::WinRtRunControlFactory);
+ addAutoReleasedObject(new Internal::WinRtQtVersionFactory);
+ addAutoReleasedObject(new Internal::WinRtDeployConfigurationFactory);
+ addAutoReleasedObject(new Internal::WinRtDeployStepFactory);
+ return true;
+}
+
+void WinRtPlugin::extensionsInitialized()
+{
+ WinRtDeviceFactory *deviceFactory = new Internal::WinRtDeviceFactory;
+ addAutoReleasedObject(deviceFactory);
+ DeviceManager *deviceManager = DeviceManager::instance();
+ if (deviceManager->isLoaded()) {
+ deviceFactory->onDevicesLoaded();
+ } else {
+ connect(deviceManager, &DeviceManager::devicesLoaded,
+ deviceFactory, &WinRtDeviceFactory::onDevicesLoaded);
+ }
+}
+
+} // namespace Internal
+} // namespace WinRt
+
+Q_EXPORT_PLUGIN(WinRt::Internal::WinRtPlugin)
diff --git a/src/plugins/winrt/winrtplugin.h b/src/plugins/winrt/winrtplugin.h
new file mode 100644
index 0000000000..72a91cbc3f
--- /dev/null
+++ b/src/plugins/winrt/winrtplugin.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTPLUGIN_H
+#define WINRTPLUGIN_H
+
+#include <extensionsystem/iplugin.h>
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtDeviceFactory;
+
+class WinRtPlugin : public ExtensionSystem::IPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "WinRt.json")
+
+public:
+ WinRtPlugin();
+
+ bool initialize(const QStringList &arguments, QString *errorMessage);
+ void extensionsInitialized();
+};
+
+} // namespace Internal
+} // namespace WinRt
+
+#endif // WINRTPLUGIN_H
diff --git a/src/plugins/winrt/winrtqtversion.cpp b/src/plugins/winrt/winrtqtversion.cpp
new file mode 100644
index 0000000000..40371a3a2c
--- /dev/null
+++ b/src/plugins/winrt/winrtqtversion.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtqtversion.h"
+
+#include "winrtconstants.h"
+
+#include <coreplugin/featureprovider.h>
+#include <qtsupport/qtsupportconstants.h>
+
+namespace WinRt {
+namespace Internal {
+
+WinRtQtVersion::WinRtQtVersion()
+{
+}
+
+WinRtQtVersion::WinRtQtVersion(const Utils::FileName &path, bool isAutodetected,
+ const QString &autodetectionSource)
+ : BaseQtVersion(path, isAutodetected, autodetectionSource)
+{
+ setDisplayName(defaultDisplayName(qtVersionString(), path, false));
+}
+
+QtSupport::BaseQtVersion *WinRtQtVersion::clone() const
+{
+ return new WinRtQtVersion(*this);
+}
+
+QString WinRtQtVersion::type() const
+{
+ return QLatin1String(Constants::WINRT_WINRTQT);
+}
+
+QString WinRtQtVersion::description() const
+{
+ return tr("Windows Runtime");
+}
+
+Core::FeatureSet WinRtQtVersion::availableFeatures() const
+{
+ return QtSupport::BaseQtVersion::availableFeatures()
+ | Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE);
+}
+
+QString WinRtQtVersion::platformName() const
+{
+ return QLatin1String(QtSupport::Constants::WINDOWS_RT_PLATFORM);
+}
+
+QString WinRtQtVersion::platformDisplayName() const
+{
+ return QLatin1String(QtSupport::Constants::WINDOWS_RT_PLATFORM_TR);
+}
+
+QList<ProjectExplorer::Abi> WinRtQtVersion::detectQtAbis() const
+{
+ return qtAbisFromLibrary(qtCorePaths(versionInfo(), qtVersionString()));
+}
+
+} // Internal
+} // WinRt
diff --git a/src/plugins/winrt/winrtqtversion.h b/src/plugins/winrt/winrtqtversion.h
new file mode 100644
index 0000000000..e482ba72e2
--- /dev/null
+++ b/src/plugins/winrt/winrtqtversion.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTQTVERSION_H
+#define WINRTQTVERSION_H
+
+#include <qtsupport/baseqtversion.h>
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtQtVersion : public QtSupport::BaseQtVersion
+{
+ Q_DECLARE_TR_FUNCTIONS(WinRt::Internal::WinRtQtVersion)
+public:
+ WinRtQtVersion();
+ WinRtQtVersion(const Utils::FileName &path, bool isAutodetected,
+ const QString &autodetectionSource);
+
+ BaseQtVersion *clone() const;
+ QString type() const;
+ QString description() const;
+ Core::FeatureSet availableFeatures() const;
+ QString platformName() const;
+ QString platformDisplayName() const;
+ QList<ProjectExplorer::Abi> detectQtAbis() const;
+};
+
+} // Internal
+} // WinRt
+
+#endif // WINRTQTVERSION_H
diff --git a/src/plugins/winrt/winrtqtversionfactory.cpp b/src/plugins/winrt/winrtqtversionfactory.cpp
new file mode 100644
index 0000000000..b7ce077a9a
--- /dev/null
+++ b/src/plugins/winrt/winrtqtversionfactory.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtqtversionfactory.h"
+
+#include "winrtconstants.h"
+#include "winrtphoneqtversion.h"
+
+#include <proparser/profileevaluator.h>
+
+#include <QFileInfo>
+
+namespace WinRt {
+namespace Internal {
+
+WinRtQtVersionFactory::WinRtQtVersionFactory(QObject *parent)
+ : QtSupport::QtVersionFactory(parent)
+{
+}
+
+WinRtQtVersionFactory::~WinRtQtVersionFactory()
+{
+}
+
+bool WinRtQtVersionFactory::canRestore(const QString &type)
+{
+ return type == QLatin1String(Constants::WINRT_WINRTQT)
+ || type == QLatin1String(Constants::WINRT_WINPHONEQT);
+}
+
+QtSupport::BaseQtVersion *WinRtQtVersionFactory::restore(const QString &type,
+ const QVariantMap &data)
+{
+ if (!canRestore(type))
+ return 0;
+ WinRtQtVersion *v = 0;
+ if (type == QLatin1String(Constants::WINRT_WINPHONEQT))
+ v = new WinRtPhoneQtVersion;
+ else
+ v = new WinRtQtVersion;
+ v->fromMap(data);
+ return v;
+}
+
+int WinRtQtVersionFactory::priority() const
+{
+ return 10;
+}
+
+QtSupport::BaseQtVersion *WinRtQtVersionFactory::create(const Utils::FileName &qmakePath,
+ ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
+{
+ QFileInfo fi = qmakePath.toFileInfo();
+ if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
+ return 0;
+
+ bool isPhone = false;
+ foreach (const QString &value, evaluator->values(QLatin1String("QMAKE_PLATFORM"))) {
+ if (value == QStringLiteral("winphone")) {
+ isPhone = true;
+ break;
+ }
+ }
+
+ return isPhone ? new WinRtPhoneQtVersion(qmakePath, isAutoDetected, autoDetectionSource)
+ : new WinRtQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
+}
+
+} // Internal
+} // WinRt
diff --git a/src/plugins/winrt/winrtqtversionfactory.h b/src/plugins/winrt/winrtqtversionfactory.h
new file mode 100644
index 0000000000..dae5a1e030
--- /dev/null
+++ b/src/plugins/winrt/winrtqtversionfactory.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTQTVERSIONFACTORY_H
+#define WINRTQTVERSIONFACTORY_H
+
+#include <qtsupport/qtversionfactory.h>
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtQtVersionFactory : public QtSupport::QtVersionFactory
+{
+public:
+ explicit WinRtQtVersionFactory(QObject *parent = 0);
+ ~WinRtQtVersionFactory();
+
+ bool canRestore(const QString &type);
+ QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
+
+ int priority() const;
+ QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
+ bool isAutoDetected = false, const QString &autoDetectionSource = QString());
+};
+
+} // Internal
+} // WinRt
+
+#endif // WINRTQTVERSIONFACTORY_H
diff --git a/src/plugins/winrt/winrtrunconfiguration.cpp b/src/plugins/winrt/winrtrunconfiguration.cpp
new file mode 100644
index 0000000000..5feaaa4133
--- /dev/null
+++ b/src/plugins/winrt/winrtrunconfiguration.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtrunconfiguration.h"
+#include "winrtrunconfigurationwidget.h"
+
+#include <coreplugin/icore.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/kitinformation.h>
+
+namespace WinRt {
+namespace Internal {
+
+static const char argumentsIdC[] = "WinRtRunConfigurationArgumentsId";
+static const char uninstallAfterStopIdC[] = "WinRtRunConfigurationUninstallAfterStopId";
+
+WinRtRunConfiguration::WinRtRunConfiguration(ProjectExplorer::Target *parent, const Core::Id &id)
+ : RunConfiguration(parent, id)
+ , m_uninstallAfterStop(false)
+{
+ setDisplayName(tr("Run App Package"));
+}
+
+QWidget *WinRtRunConfiguration::createConfigurationWidget()
+{
+ return new WinRtRunConfigurationWidget(this);
+}
+
+QVariantMap WinRtRunConfiguration::toMap() const
+{
+ QVariantMap map = RunConfiguration::toMap();
+ map.insert(QLatin1String(argumentsIdC), m_arguments);
+ map.insert(QLatin1String(uninstallAfterStopIdC), m_uninstallAfterStop);
+ return map;
+}
+
+bool WinRtRunConfiguration::fromMap(const QVariantMap &map)
+{
+ if (!RunConfiguration::fromMap(map))
+ return false;
+ setArguments(map.value(QLatin1String(argumentsIdC)).toString());
+ setUninstallAfterStop(map.value(QLatin1String(uninstallAfterStopIdC)).toBool());
+ return true;
+}
+
+void WinRtRunConfiguration::setArguments(const QString &args)
+{
+ if (m_arguments == args)
+ return;
+ m_arguments = args;
+ emit argumentsChanged(m_arguments);
+}
+
+void WinRtRunConfiguration::setUninstallAfterStop(bool b)
+{
+ m_uninstallAfterStop = b;
+ emit uninstallAfterStopChanged(m_uninstallAfterStop);
+}
+
+} // namespace Internal
+} // namespace WinRt
diff --git a/src/plugins/winrt/winrtrunconfiguration.h b/src/plugins/winrt/winrtrunconfiguration.h
new file mode 100644
index 0000000000..ce18f5ce29
--- /dev/null
+++ b/src/plugins/winrt/winrtrunconfiguration.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTRUNCONFIGURATION_H
+#define WINRTRUNCONFIGURATION_H
+
+#include <projectexplorer/runconfiguration.h>
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtRunConfiguration : public ProjectExplorer::RunConfiguration
+{
+ Q_OBJECT
+
+public:
+ explicit WinRtRunConfiguration(ProjectExplorer::Target *parent, const Core::Id &id);
+
+ QWidget *createConfigurationWidget();
+ bool isEnabled() const { return true; } // Always enabled like DLL run control
+ QVariantMap toMap() const;
+ bool fromMap(const QVariantMap &map);
+
+ const QString &arguments() const { return m_arguments; }
+ bool uninstallAfterStop() const { return m_uninstallAfterStop; }
+
+signals:
+ void argumentsChanged(QString);
+ void uninstallAfterStopChanged(bool);
+
+public slots:
+ void setArguments(const QString &args);
+ void setUninstallAfterStop(bool b);
+
+private:
+ QString m_arguments;
+ bool m_uninstallAfterStop;
+};
+
+} // namespace Internal
+} // namespace WinRt
+
+#endif // WINRTRUNCONFIGURATION_H
diff --git a/src/plugins/winrt/winrtrunconfigurationwidget.cpp b/src/plugins/winrt/winrtrunconfigurationwidget.cpp
new file mode 100644
index 0000000000..9656f2d462
--- /dev/null
+++ b/src/plugins/winrt/winrtrunconfigurationwidget.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtrunconfigurationwidget.h"
+#include "winrtrunconfiguration.h"
+#include "ui_winrtrunconfigurationwidget.h"
+
+namespace WinRt {
+namespace Internal {
+
+WinRtRunConfigurationWidget::WinRtRunConfigurationWidget(WinRtRunConfiguration *rc, QWidget *parent)
+ : Utils::DetailsWidget(parent)
+ , m_runConfiguration(rc)
+ , m_ui(new Ui::WinRtRunConfigurationWidget)
+{
+ setState(Expanded);
+ setSummaryText(tr("Launch App"));
+ setWidget(new QWidget(this));
+ m_ui->setupUi(widget());
+ widget()->setContentsMargins(0, 0, 0, 0);
+ m_ui->arguments->setText(rc->arguments());
+ connect(m_ui->arguments, SIGNAL(textChanged(QString)),
+ rc, SLOT(setArguments(QString)));
+ connect(m_ui->uninstallAfterStop, SIGNAL(stateChanged(int)),
+ SLOT(onUninstallCheckBoxChanged()));
+}
+
+WinRtRunConfigurationWidget::~WinRtRunConfigurationWidget()
+{
+ delete m_ui;
+}
+
+void WinRtRunConfigurationWidget::setArguments(const QString &args)
+{
+ m_ui->arguments->setText(args);
+}
+
+void WinRtRunConfigurationWidget::onUninstallCheckBoxChanged()
+{
+ m_runConfiguration->setUninstallAfterStop(m_ui->uninstallAfterStop->isChecked());
+}
+
+} // namespace Internal
+} // namespace WinRt
diff --git a/src/plugins/winrt/winrtrunconfigurationwidget.h b/src/plugins/winrt/winrtrunconfigurationwidget.h
new file mode 100644
index 0000000000..417308e305
--- /dev/null
+++ b/src/plugins/winrt/winrtrunconfigurationwidget.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTRUNCONFIGURATIONWIDGET_H
+#define WINRTRUNCONFIGURATIONWIDGET_H
+
+#include <utils/detailswidget.h>
+
+namespace WinRt {
+namespace Internal {
+
+namespace Ui {
+class WinRtRunConfigurationWidget;
+}
+
+class WinRtRunConfiguration;
+
+class WinRtRunConfigurationWidget : public Utils::DetailsWidget
+{
+ Q_OBJECT
+public:
+ explicit WinRtRunConfigurationWidget(WinRtRunConfiguration *rc, QWidget *parent = 0);
+ ~WinRtRunConfigurationWidget();
+
+ bool isValid() const;
+
+public slots:
+ void setArguments(const QString &args);
+
+private slots:
+ void onUninstallCheckBoxChanged();
+
+private:
+ WinRtRunConfiguration *m_runConfiguration;
+ Ui::WinRtRunConfigurationWidget *m_ui;
+};
+
+} // namespace Internal
+} // namespace WinRt
+
+#endif // WINRTRUNCONFIGURATIONWIDGET_H
diff --git a/src/plugins/winrt/winrtrunconfigurationwidget.ui b/src/plugins/winrt/winrtrunconfigurationwidget.ui
new file mode 100644
index 0000000000..fd12171c64
--- /dev/null
+++ b/src/plugins/winrt/winrtrunconfigurationwidget.ui
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WinRt::Internal::WinRtRunConfigurationWidget</class>
+ <widget class="QWidget" name="WinRt::Internal::WinRtRunConfigurationWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>248</width>
+ <height>81</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="argumentsLabel">
+ <property name="text">
+ <string>Arguments:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="arguments"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="uninstallAfterStop">
+ <property name="text">
+ <string>uninstall package after stop</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/winrt/winrtruncontrol.cpp b/src/plugins/winrt/winrtruncontrol.cpp
new file mode 100644
index 0000000000..c9c42bc220
--- /dev/null
+++ b/src/plugins/winrt/winrtruncontrol.cpp
@@ -0,0 +1,209 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtruncontrol.h"
+#include "winrtrunconfiguration.h"
+#include "winrtconstants.h"
+#include "winrtdevice.h"
+
+#include <coreplugin/idocument.h>
+#include <extensionsystem/pluginmanager.h>
+#include <projectexplorer/buildtargetinfo.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/kitinformation.h>
+#include <qtsupport/qtkitinformation.h>
+
+using ProjectExplorer::DeviceKitInformation;
+using ProjectExplorer::IDevice;
+using ProjectExplorer::RunControl;
+using ProjectExplorer::RunMode;
+using ProjectExplorer::Target;
+using Utils::QtcProcess;
+
+namespace WinRt {
+namespace Internal {
+
+WinRtRunControl::WinRtRunControl(WinRtRunConfiguration *runConfiguration, RunMode mode)
+ : RunControl(runConfiguration, mode)
+ , m_state(StoppedState)
+ , m_process(0)
+{
+ Target *target = runConfiguration->target();
+ IDevice::ConstPtr device = DeviceKitInformation::device(target->kit());
+ m_device = device.dynamicCast<const WinRtDevice>();
+
+ const QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target->kit());
+ if (!qt) {
+ appendMessage(tr("The current kit has no Qt version."),
+ Utils::ErrorMessageFormat);
+ return;
+ }
+
+ m_isWinPhone = (qt->type() == QLatin1String(Constants::WINRT_WINPHONEQT));
+ m_runnerFilePath = qt->binPath().toString() + QStringLiteral("/winrtrunner.exe");
+ if (!QFile::exists(m_runnerFilePath)) {
+ appendMessage(tr("Cannot find winrtrunner.exe in '%1'.").arg(
+ QDir::toNativeSeparators(qt->binPath().toString())),
+ Utils::ErrorMessageFormat);
+ return;
+ }
+
+ const Utils::FileName proFile = Utils::FileName::fromString(
+ target->project()->document()->filePath());
+ m_executableFilePath = target->applicationTargets().targetForProject(proFile).toString()
+ + QStringLiteral(".exe"); // ### we should not need to append ".exe" here.
+
+ m_arguments = runConfiguration->arguments();
+ m_uninstallAfterStop = runConfiguration->uninstallAfterStop();
+}
+
+void WinRtRunControl::start()
+{
+ if (m_state != StoppedState)
+ return;
+ if (!startWinRtRunner())
+ m_state = StoppedState;
+}
+
+RunControl::StopResult WinRtRunControl::stop()
+{
+ if (m_state != StartedState) {
+ m_state = StoppedState;
+ return StoppedSynchronously;
+ }
+
+ QTC_ASSERT(m_process, return StoppedSynchronously);
+ m_process->interrupt();
+ return AsynchronousStop;
+}
+
+bool WinRtRunControl::isRunning() const
+{
+ return m_state == StartedState;
+}
+
+QIcon WinRtRunControl::icon() const
+{
+ return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
+}
+
+void WinRtRunControl::cannotRetrieveDebugOutput()
+{
+ appendMessage(tr("Cannot retrieve debugging output.\n"), Utils::ErrorMessageFormat);
+}
+
+void WinRtRunControl::onProcessStarted()
+{
+ QTC_CHECK(m_state == StartingState);
+ m_state = StartedState;
+ emit started();
+}
+
+void WinRtRunControl::onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
+{
+ QTC_ASSERT(m_process, return);
+ QTC_CHECK(m_state == StartedState);
+
+ if (exitStatus == QProcess::CrashExit) {
+ appendMessage(tr("winrtrunner crashed\n"), Utils::ErrorMessageFormat);
+ } else if (exitCode != 0) {
+ appendMessage(tr("winrtrunner returned with exit code %1\n").arg(exitCode),
+ Utils::ErrorMessageFormat);
+ } else {
+ appendMessage(tr("winrtrunner finished successfully.\n"), Utils::NormalMessageFormat);
+ }
+
+ m_process->disconnect();
+ m_process->deleteLater();
+ m_process = 0;
+ m_state = StoppedState;
+ emit finished();
+}
+
+void WinRtRunControl::onProcessError()
+{
+ QTC_ASSERT(m_process, return);
+ appendMessage(tr("Error while executing winrtrunner: %1\n").arg(m_process->errorString()),
+ Utils::ErrorMessageFormat);
+ m_process->disconnect();
+ m_process->deleteLater();
+ m_process = 0;
+ m_state = StoppedState;
+ emit finished();
+}
+
+void WinRtRunControl::onProcessReadyReadStdOut()
+{
+ QTC_ASSERT(m_process, return);
+ appendMessage(QString::fromLocal8Bit(m_process->readAllStandardOutput()), Utils::StdOutFormat);
+}
+
+void WinRtRunControl::onProcessReadyReadStdErr()
+{
+ QTC_ASSERT(m_process, return);
+ appendMessage(QString::fromLocal8Bit(m_process->readAllStandardError()), Utils::StdErrFormat);
+}
+
+bool WinRtRunControl::startWinRtRunner()
+{
+ QString runnerArgs;
+ QtcProcess::addArg(&runnerArgs, QStringLiteral("--profile"));
+ QtcProcess::addArg(&runnerArgs, m_isWinPhone ? QStringLiteral("xap") : QStringLiteral("appx"));
+ if (m_device) {
+ QtcProcess::addArg(&runnerArgs, QStringLiteral("--device"));
+ QtcProcess::addArg(&runnerArgs, QString::number(m_device->deviceId()));
+ }
+ QtcProcess::addArgs(&runnerArgs, QStringLiteral("--install --start --stop --wait 0"));
+ QtcProcess::addArg(&runnerArgs, m_executableFilePath);
+ if (!m_arguments.isEmpty())
+ QtcProcess::addArgs(&runnerArgs, m_arguments);
+
+ appendMessage(QStringLiteral("winrtrunner ") + runnerArgs + QLatin1Char('\n'),
+ Utils::NormalMessageFormat);
+
+ QTC_ASSERT(!m_process, m_process->deleteLater());
+ m_process = new QtcProcess(this);
+ connect(m_process, SIGNAL(started()), SLOT(onProcessStarted()));
+ connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)),
+ SLOT(onProcessFinished(int,QProcess::ExitStatus)));
+ connect(m_process, SIGNAL(error(QProcess::ProcessError)), SLOT(onProcessError()));
+ connect(m_process, SIGNAL(readyReadStandardOutput()), SLOT(onProcessReadyReadStdOut()));
+ connect(m_process, SIGNAL(readyReadStandardError()), SLOT(onProcessReadyReadStdErr()));
+
+ m_state = StartingState;
+ m_process->setUseCtrlCStub(true);
+ m_process->setCommand(m_runnerFilePath, runnerArgs);
+ m_process->setWorkingDirectory(QFileInfo(m_executableFilePath).absolutePath());
+ m_process->start();
+ return true;
+}
+
+} // namespace Internal
+} // namespace WinRt
diff --git a/src/plugins/winrt/winrtruncontrol.h b/src/plugins/winrt/winrtruncontrol.h
new file mode 100644
index 0000000000..9e5521f20b
--- /dev/null
+++ b/src/plugins/winrt/winrtruncontrol.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTRUNCONTROL_H
+#define WINRTRUNCONTROL_H
+
+#include "winrtdevice.h"
+
+#include <projectexplorer/runconfiguration.h>
+#include <utils/qtcprocess.h>
+
+namespace QtSupport {
+class BaseQtVersion;
+} // namespace QtSupport
+
+namespace ProjectExplorer {
+class Target;
+} // namespace ProjectExplorer
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtRunConfiguration;
+
+class WinRtRunControl : public ProjectExplorer::RunControl
+{
+ Q_OBJECT
+public:
+ explicit WinRtRunControl(WinRtRunConfiguration *runConfiguration, ProjectExplorer::RunMode mode);
+
+ void start();
+ StopResult stop();
+ bool isRunning() const;
+ QIcon icon() const;
+
+private slots:
+ void cannotRetrieveDebugOutput();
+ void onProcessStarted();
+ void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
+ void onProcessError();
+ void onProcessReadyReadStdOut();
+ void onProcessReadyReadStdErr();
+
+private:
+ enum State { StartingState, StartedState, StoppedState };
+ bool startWinRtRunner();
+
+ State m_state;
+ WinRtDevice::ConstPtr m_device;
+ QString m_runnerFilePath;
+ QString m_executableFilePath;
+ QString m_arguments;
+ bool m_uninstallAfterStop;
+ bool m_isWinPhone;
+ Utils::QtcProcess *m_process;
+};
+
+} // namespace Internal
+} // namespace WinRt
+
+#endif // WINRTRUNCONTROL_H
diff --git a/src/plugins/winrt/winrtrunfactories.cpp b/src/plugins/winrt/winrtrunfactories.cpp
new file mode 100644
index 0000000000..99c5fe77b2
--- /dev/null
+++ b/src/plugins/winrt/winrtrunfactories.cpp
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "winrtrunfactories.h"
+#include "winrtrunconfiguration.h"
+#include "winrtruncontrol.h"
+#include "winrtconstants.h"
+
+#include <projectexplorer/target.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/kit.h>
+#include <projectexplorer/kitinformation.h>
+
+#include <debugger/debuggerrunner.h>
+
+#include <utils/qtcassert.h>
+
+using namespace ProjectExplorer;
+
+namespace WinRt {
+namespace Internal {
+
+static const char winrtConfigurationIdC[] = "WinRTConfigurationID";
+
+static bool isKitCompatible(Kit *kit)
+{
+ IDevice::ConstPtr device = DeviceKitInformation::device(kit);
+ if (!device)
+ return false;
+ if (device->type() == Constants::WINRT_DEVICE_TYPE_LOCAL
+ || device->type() == Constants::WINRT_DEVICE_TYPE_PHONE
+ || device->type() == Constants::WINRT_DEVICE_TYPE_EMULATOR)
+ return true;
+ return false;
+}
+
+WinRtRunConfigurationFactory::WinRtRunConfigurationFactory()
+{
+}
+
+QList<Core::Id> WinRtRunConfigurationFactory::availableCreationIds(Target *parent) const
+{
+ QList<Core::Id> result;
+ if (isKitCompatible(parent->kit()))
+ result.append(Core::Id(winrtConfigurationIdC));
+ return result;
+}
+
+QString WinRtRunConfigurationFactory::displayNameForId(const Core::Id id) const
+{
+ Q_UNUSED(id);
+ return tr("Run App Package");
+}
+
+bool WinRtRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
+{
+ Q_UNUSED(parent);
+ return id == winrtConfigurationIdC && isKitCompatible(parent->kit());
+}
+
+RunConfiguration *WinRtRunConfigurationFactory::doCreate(Target *parent, const Core::Id id)
+{
+ return new WinRtRunConfiguration(parent, id);
+}
+
+bool WinRtRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
+{
+ Q_UNUSED(parent);
+ return ProjectExplorer::idFromMap(map) == winrtConfigurationIdC && isKitCompatible(parent->kit());
+}
+
+RunConfiguration *WinRtRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
+{
+ RunConfiguration *config = new WinRtRunConfiguration(parent, winrtConfigurationIdC);
+ config->fromMap(map);
+ return config;
+}
+
+bool WinRtRunConfigurationFactory::canClone(Target *parent, RunConfiguration *product) const
+{
+ Q_UNUSED(parent);
+ Q_UNUSED(product);
+ return false;
+}
+
+RunConfiguration *WinRtRunConfigurationFactory::clone(Target *parent, RunConfiguration *product)
+{
+ Q_UNUSED(parent);
+ Q_UNUSED(product);
+ return 0;
+}
+
+WinRtRunControlFactory::WinRtRunControlFactory()
+{
+}
+
+bool WinRtRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode) const
+{
+ if (mode != NormalRunMode)
+ return false;
+ return qobject_cast<WinRtRunConfiguration *>(runConfiguration);
+}
+
+ProjectExplorer::RunControl *WinRtRunControlFactory::create(
+ RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
+{
+ WinRtRunConfiguration *rc = qobject_cast<WinRtRunConfiguration *>(runConfiguration);
+ QTC_ASSERT(rc, return 0);
+
+ switch (mode) {
+ case NormalRunMode:
+ return new WinRtRunControl(rc, mode);
+ default:
+ break;
+ }
+ *errorMessage = tr("Unsupported run mode %1.").arg(mode);
+ return 0;
+}
+
+QString WinRtRunControlFactory::displayName() const
+{
+ return tr("WinRT Run Control Factory");
+}
+
+} // namespace Internal
+} // namespace WinRt
diff --git a/src/plugins/winrt/winrtrunfactories.h b/src/plugins/winrt/winrtrunfactories.h
new file mode 100644
index 0000000000..2637fa2b10
--- /dev/null
+++ b/src/plugins/winrt/winrtrunfactories.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef WINRTRUNCONFIGURATIONFACTORY_H
+#define WINRTRUNCONFIGURATIONFACTORY_H
+
+#include <projectexplorer/runconfiguration.h>
+#include <projectexplorer/devicesupport/idevicefactory.h>
+#include <projectexplorer/deployconfiguration.h>
+
+namespace WinRt {
+namespace Internal {
+
+class WinRtRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
+{
+ Q_OBJECT
+public:
+ WinRtRunConfigurationFactory();
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+ bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
+ bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
+ bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const;
+ ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent,
+ ProjectExplorer::RunConfiguration *product);
+
+private:
+ virtual ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id);
+ virtual ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, const QVariantMap &map);
+};
+
+class WinRtRunControlFactory : public ProjectExplorer::IRunControlFactory
+{
+ Q_OBJECT
+public:
+ WinRtRunControlFactory();
+ bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode) const;
+ ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode, QString *errorMessage);
+ QString displayName() const;
+};
+
+} // namespace Internal
+} // namespace WinRt
+
+#endif // WINRTRUNCONFIGURATIONFACTORY_H