ConfigureStep: Employ task tree for running

Task-number: QTCREATORBUG-29168
Change-Id: I54281a6aaead85ca76f804956114e7c6dafeb28c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-07-12 14:51:25 +02:00
parent 52eeed5d0a
commit 60ef6e167e

View File

@@ -13,6 +13,7 @@
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <utils/aspects.h> #include <utils/aspects.h>
#include <utils/process.h>
#include <QDateTime> #include <QDateTime>
@@ -75,27 +76,31 @@ private:
void ConfigureStep::doRun() void ConfigureStep::doRun()
{ {
// Check whether we need to run configure using namespace Tasking;
const FilePath configure = project()->projectDirectory() / "configure";
const FilePath configStatus = buildDirectory() / "config.status";
if (!configStatus.exists() || configStatus.lastModified() < configure.lastModified()) const auto onSetup = [this] {
m_runConfigure = true; // Check whether we need to run configure
const FilePath configure = project()->projectDirectory() / "configure";
const FilePath configStatus = buildDirectory() / "config.status";
if (!m_runConfigure) { if (!configStatus.exists() || configStatus.lastModified() < configure.lastModified())
emit addOutput(Tr::tr("Configuration unchanged, skipping configure step."), OutputFormat::NormalMessage); m_runConfigure = true;
emit finished(true);
return;
}
ProcessParameters *param = processParameters(); if (!m_runConfigure) {
if (!param->effectiveCommand().exists()) { emit addOutput(Tr::tr("Configuration unchanged, skipping configure step."), OutputFormat::NormalMessage);
param->setCommandLine(getCommandLine(param->command().arguments())); return SetupResult::StopWithDone;
setSummaryText(param->summaryInWorkdir(displayName())); }
}
m_runConfigure = false; ProcessParameters *param = processParameters();
AbstractProcessStep::doRun(); if (!param->effectiveCommand().exists()) {
param->setCommandLine(getCommandLine(param->command().arguments()));
setSummaryText(param->summaryInWorkdir(displayName()));
}
return SetupResult::Continue;
};
const auto onDone = [this] { m_runConfigure = false; };
runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()});
} }
// ConfigureStepFactory // ConfigureStepFactory