forked from qt-creator/qt-creator
RemoteLinux: Slimmer interface of tarpackagedeploystep handling
Change-Id: Iae162718226182dd5d5af87c2aae260a9f8c7b45 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -75,7 +75,7 @@ public:
|
|||||||
RemoteLinuxCustomRunConfigurationFactory customRunConfigurationFactory;
|
RemoteLinuxCustomRunConfigurationFactory customRunConfigurationFactory;
|
||||||
RemoteLinuxDeployConfigurationFactory deployConfigurationFactory;
|
RemoteLinuxDeployConfigurationFactory deployConfigurationFactory;
|
||||||
GenericDeployStepFactory<TarPackageCreationStep> tarPackageCreationStepFactory;
|
GenericDeployStepFactory<TarPackageCreationStep> tarPackageCreationStepFactory;
|
||||||
GenericDeployStepFactory<TarPackageDeployStep> tarPackageDeployStepFactory;
|
TarPackageDeployStepFactory tarPackageDeployStepFactory;
|
||||||
GenericDeployStepFactory<GenericDirectUploadStep> genericDirectUploadStepFactory;
|
GenericDeployStepFactory<GenericDirectUploadStep> genericDirectUploadStepFactory;
|
||||||
GenericDeployStepFactory<RsyncDeployStep> rsyncDeployStepFactory;
|
GenericDeployStepFactory<RsyncDeployStep> rsyncDeployStepFactory;
|
||||||
GenericDeployStepFactory<CustomCommandDeployStep> customCommandDeployStepFactory;
|
GenericDeployStepFactory<CustomCommandDeployStep> customCommandDeployStepFactory;
|
||||||
|
@@ -26,18 +26,18 @@
|
|||||||
#include "tarpackagedeploystep.h"
|
#include "tarpackagedeploystep.h"
|
||||||
|
|
||||||
#include "abstractremotelinuxdeployservice.h"
|
#include "abstractremotelinuxdeployservice.h"
|
||||||
|
#include "abstractremotelinuxdeploystep.h"
|
||||||
#include "remotelinux_constants.h"
|
#include "remotelinux_constants.h"
|
||||||
#include "tarpackagecreationstep.h"
|
#include "tarpackagecreationstep.h"
|
||||||
|
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/devicesupport/filetransfer.h>
|
#include <projectexplorer/devicesupport/filetransfer.h>
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
|
||||||
#include <utils/processinterface.h>
|
#include <utils/processinterface.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QDateTime>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -49,10 +49,11 @@ class TarPackageInstaller : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TarPackageInstaller(QObject *parent = nullptr);
|
TarPackageInstaller();
|
||||||
|
|
||||||
void installPackage(const ProjectExplorer::IDeviceConstPtr &deviceConfig,
|
void installPackage(const IDeviceConstPtr &deviceConfig,
|
||||||
const QString &packageFilePath, bool removePackageFile);
|
const QString &packageFilePath,
|
||||||
|
bool removePackageFile);
|
||||||
void cancelInstallation();
|
void cancelInstallation();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -66,8 +67,7 @@ private:
|
|||||||
QtcProcess m_killer;
|
QtcProcess m_killer;
|
||||||
};
|
};
|
||||||
|
|
||||||
TarPackageInstaller::TarPackageInstaller(QObject *parent)
|
TarPackageInstaller::TarPackageInstaller()
|
||||||
: QObject(parent)
|
|
||||||
{
|
{
|
||||||
connect(&m_installer, &QtcProcess::readyReadStandardOutput, this, [this] {
|
connect(&m_installer, &QtcProcess::readyReadStandardOutput, this, [this] {
|
||||||
emit stdoutData(QString::fromUtf8(m_installer.readAllStandardOutput()));
|
emit stdoutData(QString::fromUtf8(m_installer.readAllStandardOutput()));
|
||||||
@@ -230,13 +230,16 @@ void TarPackageDeployService::setFinished()
|
|||||||
handleDeploymentDone();
|
handleDeploymentDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
// TarPackageDeployStep
|
||||||
|
|
||||||
using namespace Internal;
|
class TarPackageDeployStep : public AbstractRemoteLinuxDeployStep
|
||||||
|
|
||||||
TarPackageDeployStep::TarPackageDeployStep(BuildStepList *bsl, Id id)
|
|
||||||
: AbstractRemoteLinuxDeployStep(bsl, id)
|
|
||||||
{
|
{
|
||||||
|
Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::TarPackageDeployStep)
|
||||||
|
|
||||||
|
public:
|
||||||
|
TarPackageDeployStep(BuildStepList *bsl, Id id)
|
||||||
|
: AbstractRemoteLinuxDeployStep(bsl, id)
|
||||||
|
{
|
||||||
auto service = createDeployService<TarPackageDeployService>();
|
auto service = createDeployService<TarPackageDeployService>();
|
||||||
|
|
||||||
setWidgetExpandedByDefault(false);
|
setWidgetExpandedByDefault(false);
|
||||||
@@ -256,18 +259,21 @@ TarPackageDeployStep::TarPackageDeployStep(BuildStepList *bsl, Id id)
|
|||||||
service->setPackageFilePath(pStep->packageFilePath());
|
service->setPackageFilePath(pStep->packageFilePath());
|
||||||
return service->isDeploymentPossible();
|
return service->isDeploymentPossible();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Id TarPackageDeployStep::stepId()
|
|
||||||
|
// TarPackageDeployStepFactory
|
||||||
|
|
||||||
|
TarPackageDeployStepFactory::TarPackageDeployStepFactory()
|
||||||
{
|
{
|
||||||
return Constants::TarPackageDeployStepId;
|
registerStep<TarPackageDeployStep>(Constants::TarPackageDeployStepId);
|
||||||
|
setDisplayName(TarPackageDeployStep::tr("Deploy tarball via SFTP upload"));
|
||||||
|
setSupportedConfiguration(RemoteLinux::Constants::DeployToGenericLinux);
|
||||||
|
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TarPackageDeployStep::displayName()
|
} // Internal
|
||||||
{
|
} // RemoteLinux
|
||||||
return tr("Deploy tarball via SFTP upload");
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace RemoteLinux
|
|
||||||
|
|
||||||
#include "tarpackagedeploystep.moc"
|
#include "tarpackagedeploystep.moc"
|
||||||
|
@@ -25,19 +25,16 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "abstractremotelinuxdeploystep.h"
|
#include <projectexplorer/buildstep.h>
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
class TarPackageDeployStep : public AbstractRemoteLinuxDeployStep
|
class TarPackageDeployStepFactory : public ProjectExplorer::BuildStepFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TarPackageDeployStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id);
|
TarPackageDeployStepFactory();
|
||||||
|
|
||||||
static Utils::Id stepId();
|
|
||||||
static QString displayName();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace RemoteLinux
|
} // Internal
|
||||||
|
} // RemoteLinux
|
||||||
|
Reference in New Issue
Block a user