forked from qt-creator/qt-creator
WinRT: De-Q_OBJECT-ify deploy steps
Change-Id: Ie0ad653d7611a2db8421baed68a7dbb9d89e06a7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -66,17 +66,5 @@ WinRtEmulatorDeployConfigurationFactory::WinRtEmulatorDeployConfigurationFactory
|
|||||||
addInitialStep(Constants::WINRT_BUILD_STEP_DEPLOY);
|
addInitialStep(Constants::WINRT_BUILD_STEP_DEPLOY);
|
||||||
}
|
}
|
||||||
|
|
||||||
WinRtDeployStepFactory::WinRtDeployStepFactory()
|
|
||||||
{
|
|
||||||
registerStep<WinRtPackageDeploymentStep>(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 Internal
|
||||||
} // namespace WinRt
|
} // namespace WinRt
|
||||||
|
@@ -49,11 +49,5 @@ public:
|
|||||||
WinRtEmulatorDeployConfigurationFactory();
|
WinRtEmulatorDeployConfigurationFactory();
|
||||||
};
|
};
|
||||||
|
|
||||||
class WinRtDeployStepFactory : public ProjectExplorer::BuildStepFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
WinRtDeployStepFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace WinRt
|
} // namespace WinRt
|
||||||
|
@@ -27,15 +27,17 @@
|
|||||||
|
|
||||||
#include "winrtconstants.h"
|
#include "winrtconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
#include <projectexplorer/target.h>
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/buildtargetinfo.h>
|
#include <projectexplorer/buildtargetinfo.h>
|
||||||
#include <projectexplorer/deployablefile.h>
|
#include <projectexplorer/deployablefile.h>
|
||||||
#include <projectexplorer/deploymentdata.h>
|
#include <projectexplorer/deploymentdata.h>
|
||||||
#include <projectexplorer/processparameters.h>
|
#include <projectexplorer/processparameters.h>
|
||||||
|
#include <projectexplorer/projectconfigurationaspects.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
@@ -57,11 +59,62 @@ namespace Internal {
|
|||||||
const char ARGUMENTS_KEY[] = "WinRt.BuildStep.Deploy.Arguments";
|
const char ARGUMENTS_KEY[] = "WinRt.BuildStep.Deploy.Arguments";
|
||||||
const char DEFAULTARGUMENTS_KEY[] = "WinRt.BuildStep.Deploy.DefaultArguments";
|
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);
|
QTC_CHECK(!m_lineEdit);
|
||||||
auto label = new QLabel(tr("Arguments:"));
|
auto label = new QLabel(tr("Arguments:"));
|
||||||
@@ -109,21 +162,6 @@ void WinRtArgumentsAspect::setValue(const QString &value)
|
|||||||
emit changed();
|
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()
|
void WinRtArgumentsAspect::restoreDefaultValue()
|
||||||
{
|
{
|
||||||
if (m_defaultValue == m_value)
|
if (m_defaultValue == m_value)
|
||||||
@@ -346,5 +384,19 @@ bool WinRtPackageDeploymentStep::parseIconsAndExecutableFromManifest(QString man
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WinRtDeployStepFactory
|
||||||
|
|
||||||
|
WinRtDeployStepFactory::WinRtDeployStepFactory()
|
||||||
|
{
|
||||||
|
registerStep<WinRtPackageDeploymentStep>(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 Internal
|
||||||
} // namespace WinRt
|
} // namespace WinRt
|
||||||
|
@@ -25,66 +25,15 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/abstractprocessstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
#include <projectexplorer/projectconfigurationaspects.h>
|
|
||||||
|
|
||||||
namespace WinRt {
|
namespace WinRt {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class WinRtArgumentsAspect : public ProjectExplorer::ProjectConfigurationAspect
|
class WinRtDeployStepFactory final : public ProjectExplorer::BuildStepFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WinRtArgumentsAspect();
|
WinRtDeployStepFactory();
|
||||||
~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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -24,14 +24,16 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "winrtplugin.h"
|
#include "winrtplugin.h"
|
||||||
|
|
||||||
#include "winrtconstants.h"
|
#include "winrtconstants.h"
|
||||||
#include "winrtdevice.h"
|
#include "winrtdebugsupport.h"
|
||||||
#include "winrtdeployconfiguration.h"
|
#include "winrtdeployconfiguration.h"
|
||||||
#include "winrtqtversion.h"
|
#include "winrtdevice.h"
|
||||||
|
#include "winrtpackagedeploymentstep.h"
|
||||||
#include "winrtphoneqtversion.h"
|
#include "winrtphoneqtversion.h"
|
||||||
|
#include "winrtqtversion.h"
|
||||||
#include "winrtrunconfiguration.h"
|
#include "winrtrunconfiguration.h"
|
||||||
#include "winrtruncontrol.h"
|
#include "winrtruncontrol.h"
|
||||||
#include "winrtdebugsupport.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
|
Reference in New Issue
Block a user