aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/autotoolsprojectmanager
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2023-07-12 14:20:01 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2023-07-13 09:24:38 +0000
commit1bee37848eb9e64bc85138b823ac77d890b83be9 (patch)
tree07042fda88cecd705d668498573e1dc2e7937762 /src/plugins/autotoolsprojectmanager
parentfa815edae3651563acb03acd9f76a8613c92ea98 (diff)
AutogenStep: Employ task tree for running
Task-number: QTCREATORBUG-29168 Change-Id: I5b0cb5832d91f4147b273475304a1bba1dd08700 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/autotoolsprojectmanager')
-rw-r--r--src/plugins/autotoolsprojectmanager/autogenstep.cpp47
1 files changed, 26 insertions, 21 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp
index 090389716de..a6121de9276 100644
--- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp
+++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp
@@ -14,6 +14,7 @@
#include <projectexplorer/target.h>
#include <utils/aspects.h>
+#include <utils/process.h>
#include <QDateTime>
@@ -71,27 +72,31 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Id id) : AbstractProcessStep(bsl, i
void AutogenStep::doRun()
{
- // Check whether we need to run autogen.sh
- const FilePath projectDir = project()->projectDirectory();
- const FilePath configure = projectDir / "configure";
- const FilePath configureAc = projectDir / "configure.ac";
- const FilePath makefileAm = projectDir / "Makefile.am";
-
- if (!configure.exists()
- || configure.lastModified() < configureAc.lastModified()
- || configure.lastModified() < makefileAm.lastModified()) {
- m_runAutogen = true;
- }
-
- if (!m_runAutogen) {
- emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."),
- OutputFormat::NormalMessage);
- emit finished(true);
- return;
- }
-
- m_runAutogen = false;
- AbstractProcessStep::doRun();
+ using namespace Tasking;
+
+ const auto onSetup = [this] {
+ // Check whether we need to run autogen.sh
+ const FilePath projectDir = project()->projectDirectory();
+ const FilePath configure = projectDir / "configure";
+ const FilePath configureAc = projectDir / "configure.ac";
+ const FilePath makefileAm = projectDir / "Makefile.am";
+
+ if (!configure.exists()
+ || configure.lastModified() < configureAc.lastModified()
+ || configure.lastModified() < makefileAm.lastModified()) {
+ m_runAutogen = true;
+ }
+
+ if (!m_runAutogen) {
+ emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."),
+ OutputFormat::NormalMessage);
+ return SetupResult::StopWithDone;
+ }
+ return SetupResult::Continue;
+ };
+ const auto onDone = [this] { m_runAutogen = false; };
+
+ runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()});
}
// AutogenStepFactory