diff --git a/src/plugins/winrt/winrtdeployconfiguration.cpp b/src/plugins/winrt/winrtdeployconfiguration.cpp index e6eb9fd0da7..f42d48c924e 100644 --- a/src/plugins/winrt/winrtdeployconfiguration.cpp +++ b/src/plugins/winrt/winrtdeployconfiguration.cpp @@ -66,17 +66,5 @@ WinRtEmulatorDeployConfigurationFactory::WinRtEmulatorDeployConfigurationFactory addInitialStep(Constants::WINRT_BUILD_STEP_DEPLOY); } -WinRtDeployStepFactory::WinRtDeployStepFactory() -{ - registerStep(Constants::WINRT_BUILD_STEP_DEPLOY); - setDisplayName(QCoreApplication::translate("WinRt::Internal::WinRtDeployStepFactory", "Run windeployqt")); - setFlags(BuildStepInfo::Unclonable); - setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); - setSupportedDeviceTypes({Constants::WINRT_DEVICE_TYPE_LOCAL, - Constants::WINRT_DEVICE_TYPE_EMULATOR, - Constants::WINRT_DEVICE_TYPE_PHONE}); - setRepeatable(false); -} - } // namespace Internal } // namespace WinRt diff --git a/src/plugins/winrt/winrtdeployconfiguration.h b/src/plugins/winrt/winrtdeployconfiguration.h index 906679ea6d3..1ea45eb8e91 100644 --- a/src/plugins/winrt/winrtdeployconfiguration.h +++ b/src/plugins/winrt/winrtdeployconfiguration.h @@ -49,11 +49,5 @@ public: WinRtEmulatorDeployConfigurationFactory(); }; -class WinRtDeployStepFactory : public ProjectExplorer::BuildStepFactory -{ -public: - WinRtDeployStepFactory(); -}; - } // namespace Internal } // namespace WinRt diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.cpp b/src/plugins/winrt/winrtpackagedeploymentstep.cpp index f3bf853094d..32a474775bd 100644 --- a/src/plugins/winrt/winrtpackagedeploymentstep.cpp +++ b/src/plugins/winrt/winrtpackagedeploymentstep.cpp @@ -27,15 +27,17 @@ #include "winrtconstants.h" -#include -#include +#include #include #include #include #include #include +#include #include +#include #include +#include #include @@ -57,11 +59,62 @@ namespace Internal { const char ARGUMENTS_KEY[] = "WinRt.BuildStep.Deploy.Arguments"; const char DEFAULTARGUMENTS_KEY[] = "WinRt.BuildStep.Deploy.DefaultArguments"; -WinRtArgumentsAspect::WinRtArgumentsAspect() = default; +class WinRtArgumentsAspect final : public ProjectConfigurationAspect +{ + Q_DECLARE_TR_FUNCTIONS(WinRt::Internal::WinRtArgumentsAspect) -WinRtArgumentsAspect::~WinRtArgumentsAspect() = default; +public: + WinRtArgumentsAspect() = default; -void WinRtArgumentsAspect::addToLayout(ProjectExplorer::LayoutBuilder &builder) + void addToLayout(LayoutBuilder &builder) final; + + void fromMap(const QVariantMap &map) final; + void toMap(QVariantMap &map) const final; + + void setValue(const QString &value); + QString value() const { return m_value; } + + void setDefaultValue(const QString &value) { m_defaultValue = value; } + QString defaultValue() const { return m_defaultValue; } + + void restoreDefaultValue(); + +private: + FancyLineEdit *m_lineEdit = nullptr; + QString m_value; + QString m_defaultValue; +}; + +class WinRtPackageDeploymentStep final : public AbstractProcessStep +{ + Q_DECLARE_TR_FUNCTIONS(WinRt::Internal::WinRtPackageDeploymentStep) + +public: + WinRtPackageDeploymentStep(BuildStepList *bsl, Core::Id id); + + QString defaultWinDeployQtArguments() const; + + void raiseError(const QString &errorMessage); + void raiseWarning(const QString &warningMessage); + +private: + bool init() override; + void doRun() override; + bool processSucceeded(int exitCode, QProcess::ExitStatus status) override; + void stdOutput(const QString &line) override; + + bool parseIconsAndExecutableFromManifest(QString manifestFileName, QStringList *items, QString *executable); + + WinRtArgumentsAspect *m_argsAspect = nullptr; + QString m_targetFilePath; + QString m_targetDirPath; + QString m_executablePathInManifest; + QString m_mappingFileContent; + QString m_manifestFileName; + bool m_createMappingFile = false; +}; + +void WinRtArgumentsAspect::addToLayout(LayoutBuilder &builder) { QTC_CHECK(!m_lineEdit); auto label = new QLabel(tr("Arguments:")); @@ -109,21 +162,6 @@ void WinRtArgumentsAspect::setValue(const QString &value) emit changed(); } -QString WinRtArgumentsAspect::value() const -{ - return m_value; -} - -void WinRtArgumentsAspect::setDefaultValue(const QString &value) -{ - m_defaultValue = value; -} - -QString WinRtArgumentsAspect::defaultValue() const -{ - return m_defaultValue; -} - void WinRtArgumentsAspect::restoreDefaultValue() { if (m_defaultValue == m_value) @@ -346,5 +384,19 @@ bool WinRtPackageDeploymentStep::parseIconsAndExecutableFromManifest(QString man return true; } +// WinRtDeployStepFactory + +WinRtDeployStepFactory::WinRtDeployStepFactory() +{ + registerStep(Constants::WINRT_BUILD_STEP_DEPLOY); + setDisplayName(QCoreApplication::translate("WinRt::Internal::WinRtDeployStepFactory", "Run windeployqt")); + setFlags(BuildStepInfo::Unclonable); + setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); + setSupportedDeviceTypes({Constants::WINRT_DEVICE_TYPE_LOCAL, + Constants::WINRT_DEVICE_TYPE_EMULATOR, + Constants::WINRT_DEVICE_TYPE_PHONE}); + setRepeatable(false); +} + } // namespace Internal } // namespace WinRt diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.h b/src/plugins/winrt/winrtpackagedeploymentstep.h index 2b1329db798..c20898ade90 100644 --- a/src/plugins/winrt/winrtpackagedeploymentstep.h +++ b/src/plugins/winrt/winrtpackagedeploymentstep.h @@ -25,66 +25,15 @@ #pragma once -#include -#include +#include namespace WinRt { namespace Internal { -class WinRtArgumentsAspect : public ProjectExplorer::ProjectConfigurationAspect +class WinRtDeployStepFactory final : public ProjectExplorer::BuildStepFactory { - Q_OBJECT - public: - WinRtArgumentsAspect(); - ~WinRtArgumentsAspect() override; - - void addToLayout(ProjectExplorer::LayoutBuilder &builder) override; - - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; - - void setValue(const QString &value); - QString value() const; - - void setDefaultValue(const QString &value); - QString defaultValue() const; - - void restoreDefaultValue(); - -private: - Utils::FancyLineEdit *m_lineEdit = nullptr; - QString m_value; - QString m_defaultValue; -}; - -class WinRtPackageDeploymentStep : public ProjectExplorer::AbstractProcessStep -{ - Q_OBJECT - -public: - WinRtPackageDeploymentStep(ProjectExplorer::BuildStepList *bsl, Core::Id id); - - QString defaultWinDeployQtArguments() const; - - void raiseError(const QString &errorMessage); - void raiseWarning(const QString &warningMessage); - -private: - bool init() override; - void doRun() override; - bool processSucceeded(int exitCode, QProcess::ExitStatus status) override; - void stdOutput(const QString &line) override; - - bool parseIconsAndExecutableFromManifest(QString manifestFileName, QStringList *items, QString *executable); - - WinRtArgumentsAspect *m_argsAspect = nullptr; - QString m_targetFilePath; - QString m_targetDirPath; - QString m_executablePathInManifest; - QString m_mappingFileContent; - QString m_manifestFileName; - bool m_createMappingFile = false; + WinRtDeployStepFactory(); }; } // namespace Internal diff --git a/src/plugins/winrt/winrtplugin.cpp b/src/plugins/winrt/winrtplugin.cpp index c42cde7c172..314443e134d 100644 --- a/src/plugins/winrt/winrtplugin.cpp +++ b/src/plugins/winrt/winrtplugin.cpp @@ -24,14 +24,16 @@ ****************************************************************************/ #include "winrtplugin.h" + #include "winrtconstants.h" -#include "winrtdevice.h" +#include "winrtdebugsupport.h" #include "winrtdeployconfiguration.h" -#include "winrtqtversion.h" +#include "winrtdevice.h" +#include "winrtpackagedeploymentstep.h" #include "winrtphoneqtversion.h" +#include "winrtqtversion.h" #include "winrtrunconfiguration.h" #include "winrtruncontrol.h" -#include "winrtdebugsupport.h" #include #include