forked from qt-creator/qt-creator
QMakeStep: Enclose all setup inside the recipe
Task-number: QTCREATORBUG-29168 Change-Id: Ia8176625e33b1a4ba4a90234358c74e76d7fc00a Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -181,7 +181,7 @@ bool QMakeStep::init()
|
|||||||
const QtVersion *qtVersion = QtKitAspect::qtVersion(kit());
|
const QtVersion *qtVersion = QtKitAspect::qtVersion(kit());
|
||||||
|
|
||||||
if (!qtVersion) {
|
if (!qtVersion) {
|
||||||
emit addOutput(Tr::tr("No Qt version configured."), BuildStep::OutputFormat::ErrorMessage);
|
emit addOutput(Tr::tr("No Qt version configured."), OutputFormat::ErrorMessage);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ bool QMakeStep::init()
|
|||||||
if (make.isEmpty()) {
|
if (make.isEmpty()) {
|
||||||
emit addOutput(Tr::tr("Could not determine which \"make\" command to run. "
|
emit addOutput(Tr::tr("Could not determine which \"make\" command to run. "
|
||||||
"Check the \"make\" step in the build configuration."),
|
"Check the \"make\" step in the build configuration."),
|
||||||
BuildStep::OutputFormat::ErrorMessage);
|
OutputFormat::ErrorMessage);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_makeCommand = CommandLine{make, makeArguments(makeFile.path()), CommandLine::Raw};
|
m_makeCommand = CommandLine{make, makeArguments(makeFile.path()), CommandLine::Raw};
|
||||||
@@ -267,19 +267,18 @@ void QMakeStep::setupOutputFormatter(OutputFormatter *formatter)
|
|||||||
|
|
||||||
void QMakeStep::doRun()
|
void QMakeStep::doRun()
|
||||||
{
|
{
|
||||||
if (m_scriptTemplate) {
|
|
||||||
emit finished(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_needToRunQMake) {
|
|
||||||
emit addOutput(Tr::tr("Configuration unchanged, skipping qmake step."), BuildStep::OutputFormat::NormalMessage);
|
|
||||||
emit finished(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace Tasking;
|
using namespace Tasking;
|
||||||
|
|
||||||
|
const auto onSetup = [this] {
|
||||||
|
if (m_scriptTemplate)
|
||||||
|
return SetupResult::StopWithDone;
|
||||||
|
if (m_needToRunQMake)
|
||||||
|
return SetupResult::Continue;
|
||||||
|
emit addOutput(Tr::tr("Configuration unchanged, skipping qmake step."),
|
||||||
|
OutputFormat::NormalMessage);
|
||||||
|
return SetupResult::StopWithDone;
|
||||||
|
};
|
||||||
|
|
||||||
const auto setupQMake = [this](Process &process) {
|
const auto setupQMake = [this](Process &process) {
|
||||||
m_outputFormatter->setLineParsers({new QMakeParser});
|
m_outputFormatter->setLineParsers({new QMakeParser});
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
@@ -303,10 +302,11 @@ void QMakeStep::doRun()
|
|||||||
m_needToRunQMake = false;
|
m_needToRunQMake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
QList<GroupItem> processList = {ProcessTask(setupQMake, onProcessDone, onProcessDone)};
|
QList<GroupItem> processList = {onGroupSetup(onSetup),
|
||||||
|
onGroupDone(onDone),
|
||||||
|
ProcessTask(setupQMake, onProcessDone, onProcessDone)};
|
||||||
if (m_runMakeQmake)
|
if (m_runMakeQmake)
|
||||||
processList << ProcessTask(setupMakeQMake, onProcessDone, onProcessDone);
|
processList << ProcessTask(setupMakeQMake, onProcessDone, onProcessDone);
|
||||||
processList << onGroupDone(onDone);
|
|
||||||
|
|
||||||
runTaskTree(Group(processList));
|
runTaskTree(Group(processList));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user