forked from qt-creator/qt-creator
AutogenStep: Employ task tree for running
Task-number: QTCREATORBUG-29168 Change-Id: I5b0cb5832d91f4147b273475304a1bba1dd08700 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -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,27 +72,31 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Id id) : AbstractProcessStep(bsl, i
|
|||||||
|
|
||||||
void AutogenStep::doRun()
|
void AutogenStep::doRun()
|
||||||
{
|
{
|
||||||
// Check whether we need to run autogen.sh
|
using namespace Tasking;
|
||||||
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()
|
const auto onSetup = [this] {
|
||||||
|| configure.lastModified() < configureAc.lastModified()
|
// Check whether we need to run autogen.sh
|
||||||
|| configure.lastModified() < makefileAm.lastModified()) {
|
const FilePath projectDir = project()->projectDirectory();
|
||||||
m_runAutogen = true;
|
const FilePath configure = projectDir / "configure";
|
||||||
}
|
const FilePath configureAc = projectDir / "configure.ac";
|
||||||
|
const FilePath makefileAm = projectDir / "Makefile.am";
|
||||||
|
|
||||||
if (!m_runAutogen) {
|
if (!configure.exists()
|
||||||
emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."),
|
|| configure.lastModified() < configureAc.lastModified()
|
||||||
OutputFormat::NormalMessage);
|
|| configure.lastModified() < makefileAm.lastModified()) {
|
||||||
emit finished(true);
|
m_runAutogen = true;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
m_runAutogen = false;
|
if (!m_runAutogen) {
|
||||||
AbstractProcessStep::doRun();
|
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
|
// AutogenStepFactory
|
||||||
|
Reference in New Issue
Block a user