forked from qt-creator/qt-creator
RemoteLinux: Inline a few more deploy step functions
Change-Id: Ib93562b24de796f570cfa76dd3990ede5ebc6061 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -32,28 +32,21 @@ public:
|
|||||||
commandLine->setHistoryCompleter("RemoteLinuxCustomCommandDeploymentStep.History");
|
commandLine->setHistoryCompleter("RemoteLinuxCustomCommandDeploymentStep.History");
|
||||||
|
|
||||||
setInternalInitializer([this, commandLine] {
|
setInternalInitializer([this, commandLine] {
|
||||||
setCommandLine(commandLine->value().trimmed());
|
m_commandLine = commandLine->value().trimmed();
|
||||||
return isDeploymentPossible();
|
return isDeploymentPossible();
|
||||||
});
|
});
|
||||||
|
|
||||||
addMacroExpander();
|
addMacroExpander();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCommandLine(const QString &commandLine);
|
|
||||||
CheckResult isDeploymentPossible() const final;
|
CheckResult isDeploymentPossible() const final;
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
Group deployRecipe() final;
|
Group deployRecipe() final;
|
||||||
|
|
||||||
private:
|
|
||||||
QString m_commandLine;
|
QString m_commandLine;
|
||||||
};
|
};
|
||||||
|
|
||||||
void CustomCommandDeployStep::setCommandLine(const QString &commandLine)
|
|
||||||
{
|
|
||||||
m_commandLine = commandLine;
|
|
||||||
}
|
|
||||||
|
|
||||||
CheckResult CustomCommandDeployStep::isDeploymentPossible() const
|
CheckResult CustomCommandDeployStep::isDeploymentPossible() const
|
||||||
{
|
{
|
||||||
if (m_commandLine.isEmpty())
|
if (m_commandLine.isEmpty())
|
||||||
|
|||||||
@@ -49,25 +49,21 @@ RsyncDeployStep::RsyncDeployStep(BuildStepList *bsl, Id id)
|
|||||||
return CheckResult::failure(
|
return CheckResult::failure(
|
||||||
Tr::tr("rsync is only supported for transfers between different devices."));
|
Tr::tr("rsync is only supported for transfers between different devices."));
|
||||||
}
|
}
|
||||||
setIgnoreMissingFiles(ignoreMissingFiles->value());
|
m_ignoreMissingFiles = ignoreMissingFiles->value();
|
||||||
setFlags(flags->value());
|
m_flags = flags->value();
|
||||||
return isDeploymentPossible();
|
return isDeploymentPossible();
|
||||||
});
|
});
|
||||||
|
|
||||||
setRunPreparer([this] {
|
setRunPreparer([this] {
|
||||||
setDeployableFiles(target()->deploymentData().allFiles());
|
const QList<DeployableFile> files = target()->deploymentData().allFiles();
|
||||||
|
m_files.clear();
|
||||||
|
for (const DeployableFile &f : files)
|
||||||
|
m_files.append({f.localFilePath(), deviceConfiguration()->filePath(f.remoteFilePath())});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
RsyncDeployStep::~RsyncDeployStep() = default;
|
RsyncDeployStep::~RsyncDeployStep() = default;
|
||||||
|
|
||||||
void RsyncDeployStep::setDeployableFiles(const QList<DeployableFile> &files)
|
|
||||||
{
|
|
||||||
m_files.clear();
|
|
||||||
for (const DeployableFile &f : files)
|
|
||||||
m_files.append({f.localFilePath(), deviceConfiguration()->filePath(f.remoteFilePath())});
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RsyncDeployStep::isDeploymentNecessary() const
|
bool RsyncDeployStep::isDeploymentNecessary() const
|
||||||
{
|
{
|
||||||
if (m_ignoreMissingFiles)
|
if (m_ignoreMissingFiles)
|
||||||
|
|||||||
@@ -22,10 +22,6 @@ public:
|
|||||||
static Utils::Id stepId();
|
static Utils::Id stepId();
|
||||||
static QString displayName();
|
static QString displayName();
|
||||||
|
|
||||||
void setDeployableFiles(const QList<ProjectExplorer::DeployableFile> &files);
|
|
||||||
void setIgnoreMissingFiles(bool ignore) { m_ignoreMissingFiles = ignore; }
|
|
||||||
void setFlags(const QString &flags) { m_flags = flags; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isDeploymentNecessary() const final;
|
bool isDeploymentNecessary() const final;
|
||||||
Utils::Tasking::Group deployRecipe() final;
|
Utils::Tasking::Group deployRecipe() final;
|
||||||
|
|||||||
@@ -45,13 +45,11 @@ public:
|
|||||||
if (!tarCreationStep)
|
if (!tarCreationStep)
|
||||||
return CheckResult::failure(Tr::tr("No tarball creation step found."));
|
return CheckResult::failure(Tr::tr("No tarball creation step found."));
|
||||||
|
|
||||||
const FilePath tarFile =
|
m_packageFilePath =
|
||||||
FilePath::fromVariant(tarCreationStep->data(Constants::TarPackageFilePathId));
|
FilePath::fromVariant(tarCreationStep->data(Constants::TarPackageFilePathId));
|
||||||
setPackageFilePath(tarFile);
|
|
||||||
return isDeploymentPossible();
|
return isDeploymentPossible();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void setPackageFilePath(const FilePath &filePath);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString remoteFilePath() const;
|
QString remoteFilePath() const;
|
||||||
@@ -63,11 +61,6 @@ private:
|
|||||||
FilePath m_packageFilePath;
|
FilePath m_packageFilePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
void TarPackageDeployStep::setPackageFilePath(const FilePath &filePath)
|
|
||||||
{
|
|
||||||
m_packageFilePath = filePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString TarPackageDeployStep::remoteFilePath() const
|
QString TarPackageDeployStep::remoteFilePath() const
|
||||||
{
|
{
|
||||||
return QLatin1String("/tmp/") + m_packageFilePath.fileName();
|
return QLatin1String("/tmp/") + m_packageFilePath.fileName();
|
||||||
|
|||||||
Reference in New Issue
Block a user