forked from qt-creator/qt-creator
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:
@@ -26,6 +26,7 @@
|
||||
#include "customcommanddeploystep.h"
|
||||
|
||||
#include "abstractremotelinuxdeployservice.h"
|
||||
#include "abstractremotelinuxdeploystep.h"
|
||||
#include "remotelinux_constants.h"
|
||||
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
@@ -108,35 +109,41 @@ void CustomCommandDeployService::stopDeployment()
|
||||
handleDeploymentDone();
|
||||
}
|
||||
|
||||
class CustomCommandDeployStep : public AbstractRemoteLinuxDeployStep
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::CustomCommandDeployStep)
|
||||
|
||||
public:
|
||||
CustomCommandDeployStep(BuildStepList *bsl, Id id)
|
||||
: AbstractRemoteLinuxDeployStep(bsl, id)
|
||||
{
|
||||
auto service = createDeployService<CustomCommandDeployService>();
|
||||
|
||||
auto commandLine = addAspect<StringAspect>();
|
||||
commandLine->setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine");
|
||||
commandLine->setLabelText(tr("Command line:"));
|
||||
commandLine->setDisplayStyle(StringAspect::LineEditDisplay);
|
||||
commandLine->setHistoryCompleter("RemoteLinuxCustomCommandDeploymentStep.History");
|
||||
|
||||
setInternalInitializer([service, commandLine] {
|
||||
service->setCommandLine(commandLine->value().trimmed());
|
||||
return service->isDeploymentPossible();
|
||||
});
|
||||
|
||||
addMacroExpander();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// CustomCommandDeployStepFactory
|
||||
|
||||
CustomCommandDeployStepFactory::CustomCommandDeployStepFactory()
|
||||
{
|
||||
registerStep<CustomCommandDeployStep>(Constants::CustomCommandDeployStepId);
|
||||
setDisplayName(CustomCommandDeployStep::tr("Run custom remote command"));
|
||||
setSupportedConfiguration(RemoteLinux::Constants::DeployToGenericLinux);
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
|
||||
}
|
||||
|
||||
} // Internal
|
||||
|
||||
CustomCommandDeployStep::CustomCommandDeployStep(BuildStepList *bsl, Utils::Id id)
|
||||
: AbstractRemoteLinuxDeployStep(bsl, id)
|
||||
{
|
||||
auto service = createDeployService<Internal::CustomCommandDeployService>();
|
||||
|
||||
auto commandLine = addAspect<StringAspect>();
|
||||
commandLine->setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine");
|
||||
commandLine->setLabelText(tr("Command line:"));
|
||||
commandLine->setDisplayStyle(StringAspect::LineEditDisplay);
|
||||
commandLine->setHistoryCompleter("RemoteLinuxCustomCommandDeploymentStep.History");
|
||||
|
||||
setInternalInitializer([service, commandLine] {
|
||||
service->setCommandLine(commandLine->value().trimmed());
|
||||
return service->isDeploymentPossible();
|
||||
});
|
||||
|
||||
addMacroExpander();
|
||||
}
|
||||
|
||||
Utils::Id CustomCommandDeployStep::stepId()
|
||||
{
|
||||
return Constants::CustomCommandDeployStepId;
|
||||
}
|
||||
|
||||
QString CustomCommandDeployStep::displayName()
|
||||
{
|
||||
return tr("Run custom remote command");
|
||||
}
|
||||
|
||||
} // namespace RemoteLinux
|
||||
} // RemoteLinux
|
||||
|
@@ -25,21 +25,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "remotelinux_export.h"
|
||||
|
||||
#include "abstractremotelinuxdeploystep.h"
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
namespace RemoteLinux {
|
||||
namespace Internal {
|
||||
|
||||
class REMOTELINUX_EXPORT CustomCommandDeployStep : public AbstractRemoteLinuxDeployStep
|
||||
class CustomCommandDeployStepFactory : public ProjectExplorer::BuildStepFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomCommandDeployStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id);
|
||||
|
||||
static Utils::Id stepId();
|
||||
static QString displayName();
|
||||
CustomCommandDeployStepFactory();
|
||||
};
|
||||
|
||||
} // namespace RemoteLinux
|
||||
} // Internal
|
||||
} // RemoteLinux
|
||||
|
@@ -78,7 +78,7 @@ public:
|
||||
TarPackageDeployStepFactory tarPackageDeployStepFactory;
|
||||
GenericDeployStepFactory<GenericDirectUploadStep> genericDirectUploadStepFactory;
|
||||
GenericDeployStepFactory<RsyncDeployStep> rsyncDeployStepFactory;
|
||||
GenericDeployStepFactory<CustomCommandDeployStep> customCommandDeployStepFactory;
|
||||
CustomCommandDeployStepFactory customCommandDeployStepFactory;
|
||||
GenericDeployStepFactory<CheckForFreeDiskSpaceStep> checkForFreeDiskSpaceStepFactory;
|
||||
GenericDeployStepFactory<KillAppStep> killAppStepFactory;
|
||||
GenericDeployStepFactory<MakeInstallStep> makeInstallStepFactory;
|
||||
|
Reference in New Issue
Block a user