forked from qt-creator/qt-creator
QmakeMakeStep: Employ task tree for running
Task-number: QTCREATORBUG-29168 Change-Id: I4366c520f58946e372c772c643ac40cdc212ec22 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -59,15 +59,6 @@ QmakeMakeStep::QmakeMakeStep(BuildStepList *bsl, Id id)
|
|||||||
setUserArguments("clean");
|
setUserArguments("clean");
|
||||||
}
|
}
|
||||||
supportDisablingForSubdirs();
|
supportDisablingForSubdirs();
|
||||||
|
|
||||||
setDoneHook([this](bool success) {
|
|
||||||
if (!success && !isCanceled() && m_unalignedBuildDir
|
|
||||||
&& settings().warnAgainstUnalignedBuildDir()) {
|
|
||||||
const QString msg = Tr::tr("The build directory is not at the same level as the source "
|
|
||||||
"directory, which could be the reason for the build failure.");
|
|
||||||
emit addTask(BuildSystemTask(Task::Warning, msg));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmakeMakeStep::init()
|
bool QmakeMakeStep::init()
|
||||||
@@ -211,20 +202,31 @@ void QmakeMakeStep::setupOutputFormatter(OutputFormatter *formatter)
|
|||||||
|
|
||||||
void QmakeMakeStep::doRun()
|
void QmakeMakeStep::doRun()
|
||||||
{
|
{
|
||||||
if (m_scriptTarget || m_ignoredNonTopLevelBuild) {
|
using namespace Tasking;
|
||||||
emit finished(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_makeFileToCheck.exists()) {
|
const auto onSetup = [this] {
|
||||||
const bool success = ignoreReturnValue();
|
if (m_scriptTarget || m_ignoredNonTopLevelBuild)
|
||||||
if (!success)
|
return SetupResult::StopWithDone;
|
||||||
emit addOutput(Tr::tr("Cannot find Makefile. Check your build settings."), BuildStep::OutputFormat::NormalMessage);
|
|
||||||
emit finished(success);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
AbstractProcessStep::doRun();
|
if (!m_makeFileToCheck.exists()) {
|
||||||
|
const bool success = ignoreReturnValue();
|
||||||
|
if (!success) {
|
||||||
|
emit addOutput(Tr::tr("Cannot find Makefile. Check your build settings."),
|
||||||
|
OutputFormat::NormalMessage);
|
||||||
|
}
|
||||||
|
return success ? SetupResult::StopWithDone : SetupResult::StopWithError;
|
||||||
|
}
|
||||||
|
return SetupResult::Continue;
|
||||||
|
};
|
||||||
|
const auto onError = [this] {
|
||||||
|
if (m_unalignedBuildDir && settings().warnAgainstUnalignedBuildDir()) {
|
||||||
|
const QString msg = Tr::tr("The build directory is not at the same level as the source "
|
||||||
|
"directory, which could be the reason for the build failure.");
|
||||||
|
emit addTask(BuildSystemTask(Task::Warning, msg));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
runTaskTree({onGroupSetup(onSetup), onGroupError(onError), defaultProcessTask()});
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QmakeMakeStep::displayArguments() const
|
QStringList QmakeMakeStep::displayArguments() const
|
||||||
|
Reference in New Issue
Block a user