AutoreconfStep: Employ task tree for running

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

View File

@@ -13,6 +13,7 @@
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <utils/aspects.h> #include <utils/aspects.h>
#include <utils/process.h>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
@@ -61,20 +62,24 @@ public:
void doRun() override void doRun() override
{ {
// Check whether we need to run autoreconf using namespace Tasking;
const FilePath configure = project()->projectDirectory() / "configure";
if (!configure.exists())
m_runAutoreconf = true;
if (!m_runAutoreconf) { const auto onSetup = [this] {
emit addOutput(Tr::tr("Configuration unchanged, skipping autoreconf step."), // Check whether we need to run autoreconf
OutputFormat::NormalMessage); const FilePath configure = project()->projectDirectory() / "configure";
emit finished(true); if (!configure.exists())
return; m_runAutoreconf = true;
}
m_runAutoreconf = false; if (!m_runAutoreconf) {
AbstractProcessStep::doRun(); emit addOutput(Tr::tr("Configuration unchanged, skipping autoreconf step."),
OutputFormat::NormalMessage);
return SetupResult::StopWithDone;
}
return SetupResult::Continue;
};
const auto onDone = [this] { m_runAutoreconf = false; };
runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()});
} }
private: private: