AutogenStep: Employ task tree for running

Task-number: QTCREATORBUG-29168
Change-Id: I5b0cb5832d91f4147b273475304a1bba1dd08700
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-07-12 14:20:01 +02:00
parent fa815edae3
commit 1bee37848e

View File

@@ -14,6 +14,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>
@@ -71,6 +72,9 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Id id) : AbstractProcessStep(bsl, i
void AutogenStep::doRun() void AutogenStep::doRun()
{ {
using namespace Tasking;
const auto onSetup = [this] {
// Check whether we need to run autogen.sh // Check whether we need to run autogen.sh
const FilePath projectDir = project()->projectDirectory(); const FilePath projectDir = project()->projectDirectory();
const FilePath configure = projectDir / "configure"; const FilePath configure = projectDir / "configure";
@@ -86,12 +90,13 @@ void AutogenStep::doRun()
if (!m_runAutogen) { if (!m_runAutogen) {
emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."), emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."),
OutputFormat::NormalMessage); OutputFormat::NormalMessage);
emit finished(true); return SetupResult::StopWithDone;
return;
} }
return SetupResult::Continue;
};
const auto onDone = [this] { m_runAutogen = false; };
m_runAutogen = false; runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()});
AbstractProcessStep::doRun();
} }
// AutogenStepFactory // AutogenStepFactory