forked from qt-creator/qt-creator
AutoTools: Simplify build step implementations
... and make it usable remotely. Change-Id: Ib19b661ba5cbb7b8a585c0b130dd672605ff0506 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -15,27 +15,12 @@
|
||||
#include <utils/aspects.h>
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
// Helper Function
|
||||
|
||||
static QString projectDirRelativeToBuildDir(BuildConfiguration *bc)
|
||||
{
|
||||
const QDir buildDir(bc->buildDirectory().toString());
|
||||
QString projDirToBuildDir = buildDir.relativeFilePath(
|
||||
bc->project()->projectDirectory().toString());
|
||||
if (projDirToBuildDir.isEmpty())
|
||||
return QString("./");
|
||||
if (!projDirToBuildDir.endsWith('/'))
|
||||
projDirToBuildDir.append('/');
|
||||
return projDirToBuildDir;
|
||||
}
|
||||
|
||||
// ConfigureStep
|
||||
|
||||
///**
|
||||
@@ -77,8 +62,6 @@ ConfigureStep::ConfigureStep(BuildStepList *bsl, Id id)
|
||||
m_runConfigure = true;
|
||||
});
|
||||
|
||||
setWorkingDirectoryProvider([this] { return project()->projectDirectory(); });
|
||||
|
||||
setCommandLineProvider([this, arguments] {
|
||||
return getCommandLine(arguments->value());
|
||||
});
|
||||
@@ -93,24 +76,17 @@ ConfigureStep::ConfigureStep(BuildStepList *bsl, Id id)
|
||||
|
||||
CommandLine ConfigureStep::getCommandLine(const QString &arguments)
|
||||
{
|
||||
BuildConfiguration *bc = buildConfiguration();
|
||||
|
||||
return CommandLine({FilePath::fromString(projectDirRelativeToBuildDir(bc) + "configure"),
|
||||
arguments,
|
||||
CommandLine::Raw});
|
||||
return {project()->projectDirectory() / "configure", arguments, CommandLine::Raw};
|
||||
}
|
||||
|
||||
void ConfigureStep::doRun()
|
||||
{
|
||||
//Check whether we need to run configure
|
||||
const QString projectDir(project()->projectDirectory().toString());
|
||||
const QFileInfo configureInfo(projectDir + "/configure");
|
||||
const QFileInfo configStatusInfo(buildDirectory().toString() + "/config.status");
|
||||
// Check whether we need to run configure
|
||||
const FilePath configure = project()->projectDirectory() / "configure";
|
||||
const FilePath configStatus = buildDirectory() / "config.status";
|
||||
|
||||
if (!configStatusInfo.exists()
|
||||
|| configStatusInfo.lastModified() < configureInfo.lastModified()) {
|
||||
if (!configStatus.exists() || configStatus.lastModified() < configure.lastModified())
|
||||
m_runConfigure = true;
|
||||
}
|
||||
|
||||
if (!m_runConfigure) {
|
||||
emit addOutput(Tr::tr("Configuration unchanged, skipping configure step."), OutputFormat::NormalMessage);
|
||||
|
||||
Reference in New Issue
Block a user