RemoteLinux: Slimmer interface of custom command deploy step handling

Change-Id: Iad10d6bd111c9f06adb510aae19e861bbce3425d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2022-06-02 18:16:46 +02:00
parent fe63fb2881
commit 8d659cb7db
3 changed files with 45 additions and 43 deletions

View File

@@ -26,6 +26,7 @@
#include "customcommanddeploystep.h" #include "customcommanddeploystep.h"
#include "abstractremotelinuxdeployservice.h" #include "abstractremotelinuxdeployservice.h"
#include "abstractremotelinuxdeploystep.h"
#include "remotelinux_constants.h" #include "remotelinux_constants.h"
#include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/idevice.h>
@@ -108,12 +109,15 @@ void CustomCommandDeployService::stopDeployment()
handleDeploymentDone(); handleDeploymentDone();
} }
} // Internal class CustomCommandDeployStep : public AbstractRemoteLinuxDeployStep
CustomCommandDeployStep::CustomCommandDeployStep(BuildStepList *bsl, Utils::Id id)
: AbstractRemoteLinuxDeployStep(bsl, id)
{ {
auto service = createDeployService<Internal::CustomCommandDeployService>(); Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::CustomCommandDeployStep)
public:
CustomCommandDeployStep(BuildStepList *bsl, Id id)
: AbstractRemoteLinuxDeployStep(bsl, id)
{
auto service = createDeployService<CustomCommandDeployService>();
auto commandLine = addAspect<StringAspect>(); auto commandLine = addAspect<StringAspect>();
commandLine->setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine"); commandLine->setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine");
@@ -127,16 +131,19 @@ CustomCommandDeployStep::CustomCommandDeployStep(BuildStepList *bsl, Utils::Id i
}); });
addMacroExpander(); addMacroExpander();
} }
};
Utils::Id CustomCommandDeployStep::stepId()
// CustomCommandDeployStepFactory
CustomCommandDeployStepFactory::CustomCommandDeployStepFactory()
{ {
return Constants::CustomCommandDeployStepId; registerStep<CustomCommandDeployStep>(Constants::CustomCommandDeployStepId);
setDisplayName(CustomCommandDeployStep::tr("Run custom remote command"));
setSupportedConfiguration(RemoteLinux::Constants::DeployToGenericLinux);
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
} }
QString CustomCommandDeployStep::displayName() } // Internal
{ } // RemoteLinux
return tr("Run custom remote command");
}
} // namespace RemoteLinux

View File

@@ -25,21 +25,16 @@
#pragma once #pragma once
#include "remotelinux_export.h" #include <projectexplorer/buildstep.h>
#include "abstractremotelinuxdeploystep.h"
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
class REMOTELINUX_EXPORT CustomCommandDeployStep : public AbstractRemoteLinuxDeployStep class CustomCommandDeployStepFactory : public ProjectExplorer::BuildStepFactory
{ {
Q_OBJECT
public: public:
CustomCommandDeployStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); CustomCommandDeployStepFactory();
static Utils::Id stepId();
static QString displayName();
}; };
} // namespace RemoteLinux } // Internal
} // RemoteLinux

View File

@@ -78,7 +78,7 @@ public:
TarPackageDeployStepFactory tarPackageDeployStepFactory; TarPackageDeployStepFactory tarPackageDeployStepFactory;
GenericDeployStepFactory<GenericDirectUploadStep> genericDirectUploadStepFactory; GenericDeployStepFactory<GenericDirectUploadStep> genericDirectUploadStepFactory;
GenericDeployStepFactory<RsyncDeployStep> rsyncDeployStepFactory; GenericDeployStepFactory<RsyncDeployStep> rsyncDeployStepFactory;
GenericDeployStepFactory<CustomCommandDeployStep> customCommandDeployStepFactory; CustomCommandDeployStepFactory customCommandDeployStepFactory;
GenericDeployStepFactory<CheckForFreeDiskSpaceStep> checkForFreeDiskSpaceStepFactory; GenericDeployStepFactory<CheckForFreeDiskSpaceStep> checkForFreeDiskSpaceStepFactory;
GenericDeployStepFactory<KillAppStep> killAppStepFactory; GenericDeployStepFactory<KillAppStep> killAppStepFactory;
GenericDeployStepFactory<MakeInstallStep> makeInstallStepFactory; GenericDeployStepFactory<MakeInstallStep> makeInstallStepFactory;