RemoteLinux: Declare step id constants publicly

... so the steps can be referred to by Id only in some places in
Qdb (and Qnx later), thus weakening the hard compile-time dependencies
between the plugins.

Change-Id: Ia3000b5044a8d6eb29a424a05bccb88a4c6126ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-02-21 18:35:27 +01:00
parent ed5e6a4999
commit 203597eceb
5 changed files with 22 additions and 17 deletions

View File

@@ -26,20 +26,15 @@
#include "qdbdeployconfigurationfactory.h" #include "qdbdeployconfigurationfactory.h"
#include "qdbconstants.h" #include "qdbconstants.h"
#include "qdbstopapplicationstep.h"
#include <projectexplorer/deploymentdataview.h> #include <projectexplorer/deploymentdataview.h>
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <remotelinux/genericdirectuploadstep.h> #include <remotelinux/remotelinux_constants.h>
#include <remotelinux/makeinstallstep.h>
#include <remotelinux/remotelinuxcheckforfreediskspacestep.h>
#include <remotelinux/remotelinuxdeployconfiguration.h>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace RemoteLinux;
namespace Qdb { namespace Qdb {
namespace Internal { namespace Internal {
@@ -52,14 +47,14 @@ QdbDeployConfigurationFactory::QdbDeployConfigurationFactory()
"Deploy to Boot2Qt target")); "Deploy to Boot2Qt target"));
setUseDeploymentDataView(); setUseDeploymentDataView();
addInitialStep(RemoteLinux::MakeInstallStep::stepId(), [](Target *target) { addInitialStep(RemoteLinux::Constants::MakeInstallStepId, [](Target *target) {
const Project * const prj = target->project(); const Project * const prj = target->project();
return prj->deploymentKnowledge() == DeploymentKnowledge::Bad return prj->deploymentKnowledge() == DeploymentKnowledge::Bad
&& prj->hasMakeInstallEquivalent(); && prj->hasMakeInstallEquivalent();
}); });
addInitialStep(RemoteLinuxCheckForFreeDiskSpaceStep::stepId()); addInitialStep(RemoteLinux::Constants::CheckForFreeDiskSpaceId);
addInitialStep(Qdb::Constants::QdbStopApplicationStepId); addInitialStep(Qdb::Constants::QdbStopApplicationStepId);
addInitialStep(GenericDirectUploadStep::stepId()); addInitialStep(RemoteLinux::Constants::DirectUploadStepId);
} }
} // namespace Internal } // namespace Internal

View File

@@ -45,9 +45,10 @@
#include <qtsupport/qtversionfactory.h> #include <qtsupport/qtversionfactory.h>
#include <remotelinux/remotelinuxcheckforfreediskspacestep.h>
#include <remotelinux/genericdirectuploadstep.h> #include <remotelinux/genericdirectuploadstep.h>
#include <remotelinux/makeinstallstep.h> #include <remotelinux/makeinstallstep.h>
#include <remotelinux/remotelinuxcheckforfreediskspacestep.h>
#include <remotelinux/remotelinux_constants.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
@@ -154,9 +155,9 @@ template <class Step>
class QdbDeployStepFactory : public ProjectExplorer::BuildStepFactory class QdbDeployStepFactory : public ProjectExplorer::BuildStepFactory
{ {
public: public:
QdbDeployStepFactory() explicit QdbDeployStepFactory(Core::Id id)
{ {
registerStep<Step>(Step::stepId()); registerStep<Step>(id);
setDisplayName(Step::displayName()); setDisplayName(Step::displayName());
setSupportedConfiguration(Constants::QdbDeployConfigurationId); setSupportedConfiguration(Constants::QdbDeployConfigurationId);
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
@@ -176,9 +177,11 @@ public:
QdbMakeDefaultAppStepFactory m_makeDefaultAppStepFactory; QdbMakeDefaultAppStepFactory m_makeDefaultAppStepFactory;
QdbDeployStepFactory<RemoteLinux::RemoteLinuxCheckForFreeDiskSpaceStep> QdbDeployStepFactory<RemoteLinux::RemoteLinuxCheckForFreeDiskSpaceStep>
m_checkForFreeDiskSpaceStepFactory; m_checkForFreeDiskSpaceStepFactory{RemoteLinux::Constants::CheckForFreeDiskSpaceId};
QdbDeployStepFactory<RemoteLinux::GenericDirectUploadStep> m_directUploadStepFactory; QdbDeployStepFactory<RemoteLinux::GenericDirectUploadStep>
QdbDeployStepFactory<RemoteLinux::MakeInstallStep> m_makeInstallStepFactory; m_directUploadStepFactory{RemoteLinux::Constants::DirectUploadStepId};
QdbDeployStepFactory<RemoteLinux::MakeInstallStep>
m_makeInstallStepFactory{RemoteLinux::Constants::MakeInstallStepId};
const QList<Core::Id> supportedRunConfigs { const QList<Core::Id> supportedRunConfigs {
m_runConfigFactory.id(), m_runConfigFactory.id(),

View File

@@ -26,6 +26,7 @@
#include "genericdirectuploadstep.h" #include "genericdirectuploadstep.h"
#include "genericdirectuploadservice.h" #include "genericdirectuploadservice.h"
#include "remotelinux_constants.h"
#include <projectexplorer/deploymentdata.h> #include <projectexplorer/deploymentdata.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
@@ -79,7 +80,7 @@ GenericDirectUploadStep::~GenericDirectUploadStep() = default;
Core::Id GenericDirectUploadStep::stepId() Core::Id GenericDirectUploadStep::stepId()
{ {
return "RemoteLinux.DirectUploadStep"; return Constants::DirectUploadStepId;
} }
QString GenericDirectUploadStep::displayName() QString GenericDirectUploadStep::displayName()

View File

@@ -25,6 +25,8 @@
#include "makeinstallstep.h" #include "makeinstallstep.h"
#include "remotelinux_constants.h"
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsteplist.h>
#include <projectexplorer/buildsystem.h> #include <projectexplorer/buildsystem.h>
@@ -112,7 +114,7 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Core::Id id) : MakeStep(
Core::Id MakeInstallStep::stepId() Core::Id MakeInstallStep::stepId()
{ {
return "RemoteLinux.MakeInstall"; return Constants::MakeInstallStepId;
} }
QString MakeInstallStep::displayName() QString MakeInstallStep::displayName()

View File

@@ -30,5 +30,9 @@ namespace Constants {
const char GenericLinuxOsType[] = "GenericLinuxOsType"; const char GenericLinuxOsType[] = "GenericLinuxOsType";
const char CheckForFreeDiskSpaceId[] = "RemoteLinux.CheckForFreeDiskSpaceStep";
const char DirectUploadStepId[] = "RemoteLinux.DirectUploadStep";
const char MakeInstallStepId[] = "RemoteLinux.MakeInstall";
} // Constants } // Constants
} // RemoteLinux } // RemoteLinux