diff --git a/src/plugins/remotelinux/genericdeploystep.cpp b/src/plugins/remotelinux/genericdeploystep.cpp index cba80697f08..936f55348bb 100644 --- a/src/plugins/remotelinux/genericdeploystep.cpp +++ b/src/plugins/remotelinux/genericdeploystep.cpp @@ -7,6 +7,7 @@ #include "remotelinux_constants.h" #include "remotelinuxtr.h" +#include #include #include #include @@ -28,9 +29,9 @@ using namespace Utils; namespace RemoteLinux::Internal { -// RsyncDeployStep +// GenericDeployStep -class GenericDeployStep : public AbstractRemoteLinuxDeployStep +class GenericDeployStep final : public AbstractRemoteLinuxDeployStep { public: GenericDeployStep(BuildStepList *bsl, Id id) @@ -223,10 +224,21 @@ GroupItem GenericDeployStep::deployRecipe() // Factory -GenericDeployStepFactory::GenericDeployStepFactory() +class GenericDeployStepFactory final : public BuildStepFactory { - registerStep(Constants::GenericDeployStepId); - setDisplayName(Tr::tr("Deploy files")); +public: + GenericDeployStepFactory() + { + registerStep(Constants::GenericDeployStepId); + setDisplayName(Tr::tr("Deploy files")); + setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); + setSupportedDeviceType(RemoteLinux::Constants::GenericLinuxOsType); + } +}; + +void setupGenericDeployStep() +{ + static GenericDeployStepFactory theGenericDeployStepFactory; } } // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/genericdeploystep.h b/src/plugins/remotelinux/genericdeploystep.h index 4967e2c7bc2..2264d8cd9b3 100644 --- a/src/plugins/remotelinux/genericdeploystep.h +++ b/src/plugins/remotelinux/genericdeploystep.h @@ -3,14 +3,8 @@ #pragma once -#include - namespace RemoteLinux::Internal { -class GenericDeployStepFactory : public ProjectExplorer::BuildStepFactory -{ -public: - GenericDeployStepFactory(); -}; +void setupGenericDeployStep(); } // namespace RemoteLinux::Internal diff --git a/src/plugins/remotelinux/genericdirectuploadstep.cpp b/src/plugins/remotelinux/genericdirectuploadstep.cpp index 383722873bc..bec1c7398cc 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.cpp +++ b/src/plugins/remotelinux/genericdirectuploadstep.cpp @@ -7,10 +7,12 @@ #include "remotelinux_constants.h" #include "remotelinuxtr.h" +#include #include #include #include #include +#include #include #include @@ -35,7 +37,7 @@ struct UploadStorage QList filesToUpload; }; -class GenericDirectUploadStep : public AbstractRemoteLinuxDeployStep +class GenericDirectUploadStep final : public AbstractRemoteLinuxDeployStep { public: GenericDirectUploadStep(BuildStepList *bsl, Id id) @@ -266,10 +268,21 @@ GroupItem GenericDirectUploadStep::deployRecipe() // Factory -GenericDirectUploadStepFactory::GenericDirectUploadStepFactory() +class GenericDirectUploadStepFactory final : public BuildStepFactory { - registerStep(Constants::DirectUploadStepId); - setDisplayName(Tr::tr("Upload files via SFTP")); +public: + GenericDirectUploadStepFactory() + { + registerStep(Constants::DirectUploadStepId); + setDisplayName(Tr::tr("Upload files via SFTP")); + setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); + setSupportedDeviceType(RemoteLinux::Constants::GenericLinuxOsType); + } +}; + +void setupGenericDirectUploadStep() +{ + static GenericDirectUploadStepFactory theGenericDirectUploadStepFactory; } } // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/genericdirectuploadstep.h b/src/plugins/remotelinux/genericdirectuploadstep.h index 3e825caf5c6..1bfcd8c9012 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.h +++ b/src/plugins/remotelinux/genericdirectuploadstep.h @@ -3,14 +3,8 @@ #pragma once -#include - namespace RemoteLinux::Internal { -class GenericDirectUploadStepFactory : public ProjectExplorer::BuildStepFactory -{ -public: - GenericDirectUploadStepFactory(); -}; +void setupGenericDirectUploadStep(); } // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 8b678bea961..604c41f2182 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -7,6 +7,7 @@ #include "remotelinuxtr.h" #include +#include #include #include #include @@ -32,17 +33,17 @@ using namespace Utils; namespace RemoteLinux::Internal { -class MakeInstallStep : public MakeStep +class MakeInstallStep final : public MakeStep { public: MakeInstallStep(BuildStepList *parent, Id id); private: - void fromMap(const Store &map) override; - QWidget *createConfigWidget() override; - bool init() override; + void fromMap(const Store &map) final; + QWidget *createConfigWidget() final; + bool init() final; Tasking::GroupItem runRecipe() final; - bool isJobCountSupported() const override { return false; } + bool isJobCountSupported() const final { return false; } void updateCommandFromAspect(); void updateArgsFromAspect(); @@ -270,10 +271,21 @@ void MakeInstallStep::fromMap(const Store &map) // Factory -MakeInstallStepFactory::MakeInstallStepFactory() +class MakeInstallStepFactory final : public BuildStepFactory { - registerStep(Constants::MakeInstallStepId); - setDisplayName(Tr::tr("Install into temporary host directory")); +public: + MakeInstallStepFactory() + { + registerStep(Constants::MakeInstallStepId); + setDisplayName(Tr::tr("Install into temporary host directory")); + setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); + setSupportedDeviceType(RemoteLinux::Constants::GenericLinuxOsType); + } +}; + +void setupMakeInstallStep() +{ + static MakeInstallStepFactory theMakeInstallStepFactory; } } // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/makeinstallstep.h b/src/plugins/remotelinux/makeinstallstep.h index d2ffed1356a..b312bbee903 100644 --- a/src/plugins/remotelinux/makeinstallstep.h +++ b/src/plugins/remotelinux/makeinstallstep.h @@ -3,14 +3,8 @@ #pragma once -#include - namespace RemoteLinux::Internal { -class MakeInstallStepFactory : public ProjectExplorer::BuildStepFactory -{ -public: - MakeInstallStepFactory(); -}; +void setupMakeInstallStep(); -} // namespace RemoteLinux::Internal +} // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/remotelinuxdeploysupport.cpp b/src/plugins/remotelinux/remotelinuxdeploysupport.cpp index 94a6aba141e..bfb2aee9747 100644 --- a/src/plugins/remotelinux/remotelinuxdeploysupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdeploysupport.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "remotelinuxdebugsupport.h" +#include "remotelinuxdeploysupport.h" #include "genericdeploystep.h" #include "genericdirectuploadstep.h" @@ -14,24 +14,11 @@ #include #include -#include - using namespace ProjectExplorer; namespace RemoteLinux::Internal { -template -class RemoteLinuxDeployStepFactory : public Factory -{ -public: - RemoteLinuxDeployStepFactory() - { - Factory::setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); - Factory::setSupportedDeviceType(RemoteLinux::Constants::GenericLinuxOsType); - } -}; - -class RemoteLinuxDeployConfigurationFactory : public DeployConfigurationFactory +class RemoteLinuxDeployConfigurationFactory final : public DeployConfigurationFactory { public: RemoteLinuxDeployConfigurationFactory() @@ -54,10 +41,13 @@ public: } }); + // Make sure we can use the steps below. + setupGenericDirectUploadStep(); + setupGenericDeployStep(); + setupMakeInstallStep(); + addInitialStep(Constants::MakeInstallStepId, needsMakeInstall); addInitialStep(Constants::KillAppStepId); - - // TODO: Rename RsyncDeployStep to something more generic. addInitialStep(Constants::GenericDeployStepId); } }; @@ -65,9 +55,6 @@ public: void setupRemoteLinuxDeploySupport() { static RemoteLinuxDeployConfigurationFactory deployConfigurationFactory; - static RemoteLinuxDeployStepFactory genericDirectUploadStep; - static RemoteLinuxDeployStepFactory rsyncDeployStepFactory; - static RemoteLinuxDeployStepFactory makeInstallStepFactory; } } // RemoteLinux::Internal