forked from qt-creator/qt-creator
BuildStep: Remove finished() signal and use FutureInterface to report
Remove the finished() signal that is (sometimes) used to report that a buildstep is done and use the FutureInterface for that purpose consistently. Change-Id: Ibe5520b562b91f1a7f4fc73ee898b33b930029ec Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -417,8 +417,7 @@ void AndroidDeployQtStep::run(QFutureInterface<bool> &fi)
|
|||||||
if (!m_avdName.isEmpty()) {
|
if (!m_avdName.isEmpty()) {
|
||||||
QString serialNumber = AndroidConfigurations::currentConfig().waitForAvd(m_avdName, fi);
|
QString serialNumber = AndroidConfigurations::currentConfig().waitForAvd(m_avdName, fi);
|
||||||
if (serialNumber.isEmpty()) {
|
if (serialNumber.isEmpty()) {
|
||||||
fi.reportResult(false);
|
reportRunResult(fi, false);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_serialNumber = serialNumber;
|
m_serialNumber = serialNumber;
|
||||||
@@ -460,8 +459,7 @@ void AndroidDeployQtStep::run(QFutureInterface<bool> &fi)
|
|||||||
<< QLatin1String("/system/") + m_libdir + QLatin1String("/libc.so")
|
<< QLatin1String("/system/") + m_libdir + QLatin1String("/libc.so")
|
||||||
<< QString::fromLatin1("%1/libc.so").arg(m_buildDirectory));
|
<< QString::fromLatin1("%1/libc.so").arg(m_buildDirectory));
|
||||||
|
|
||||||
fi.reportResult(returnValue == Success ? true : false);
|
reportRunResult(fi, returnValue == Success);
|
||||||
fi.reportFinished();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidDeployQtStep::runCommand(const QString &program, const QStringList &arguments)
|
void AndroidDeployQtStep::runCommand(const QString &program, const QStringList &arguments)
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ bool AutogenStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
return AbstractProcessStep::init(earlierSteps);
|
return AbstractProcessStep::init(earlierSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutogenStep::run(QFutureInterface<bool> &interface)
|
void AutogenStep::run(QFutureInterface<bool> &fi)
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
BuildConfiguration *bc = buildConfiguration();
|
||||||
|
|
||||||
@@ -175,13 +175,12 @@ void AutogenStep::run(QFutureInterface<bool> &interface)
|
|||||||
|
|
||||||
if (!m_runAutogen) {
|
if (!m_runAutogen) {
|
||||||
emit addOutput(tr("Configuration unchanged, skipping autogen step."), BuildStep::MessageOutput);
|
emit addOutput(tr("Configuration unchanged, skipping autogen step."), BuildStep::MessageOutput);
|
||||||
interface.reportResult(true);
|
reportRunResult(fi, true);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_runAutogen = false;
|
m_runAutogen = false;
|
||||||
AbstractProcessStep::run(interface);
|
AbstractProcessStep::run(fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStepConfigWidget *AutogenStep::createConfigWidget()
|
BuildStepConfigWidget *AutogenStep::createConfigWidget()
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public:
|
|||||||
explicit AutogenStep(ProjectExplorer::BuildStepList *bsl);
|
explicit AutogenStep(ProjectExplorer::BuildStepList *bsl);
|
||||||
|
|
||||||
bool init(QList<const BuildStep *> &earlierSteps) override;
|
bool init(QList<const BuildStep *> &earlierSteps) override;
|
||||||
void run(QFutureInterface<bool> &interface) override;
|
void run(QFutureInterface<bool> &fi) override;
|
||||||
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
||||||
bool immutable() const override;
|
bool immutable() const override;
|
||||||
QString additionalArguments() const;
|
QString additionalArguments() const;
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ bool AutoreconfStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
return AbstractProcessStep::init(earlierSteps);
|
return AbstractProcessStep::init(earlierSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoreconfStep::run(QFutureInterface<bool> &interface)
|
void AutoreconfStep::run(QFutureInterface<bool> &fi)
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
BuildConfiguration *bc = buildConfiguration();
|
||||||
|
|
||||||
@@ -170,13 +170,12 @@ void AutoreconfStep::run(QFutureInterface<bool> &interface)
|
|||||||
|
|
||||||
if (!m_runAutoreconf) {
|
if (!m_runAutoreconf) {
|
||||||
emit addOutput(tr("Configuration unchanged, skipping autoreconf step."), BuildStep::MessageOutput);
|
emit addOutput(tr("Configuration unchanged, skipping autoreconf step."), BuildStep::MessageOutput);
|
||||||
interface.reportResult(true);
|
reportRunResult(fi, true);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_runAutoreconf = false;
|
m_runAutoreconf = false;
|
||||||
AbstractProcessStep::run(interface);
|
AbstractProcessStep::run(fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStepConfigWidget *AutoreconfStep::createConfigWidget()
|
BuildStepConfigWidget *AutoreconfStep::createConfigWidget()
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public:
|
|||||||
explicit AutoreconfStep(ProjectExplorer::BuildStepList *bsl);
|
explicit AutoreconfStep(ProjectExplorer::BuildStepList *bsl);
|
||||||
|
|
||||||
bool init(QList<const BuildStep *> &earlierSteps) override;
|
bool init(QList<const BuildStep *> &earlierSteps) override;
|
||||||
void run(QFutureInterface<bool> &interface) override;
|
void run(QFutureInterface<bool> &fi) override;
|
||||||
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
||||||
bool immutable() const override;
|
bool immutable() const override;
|
||||||
QString additionalArguments() const;
|
QString additionalArguments() const;
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ bool ConfigureStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
return AbstractProcessStep::init(earlierSteps);
|
return AbstractProcessStep::init(earlierSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureStep::run(QFutureInterface<bool>& interface)
|
void ConfigureStep::run(QFutureInterface<bool>& fi)
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
BuildConfiguration *bc = buildConfiguration();
|
||||||
|
|
||||||
@@ -187,13 +187,12 @@ void ConfigureStep::run(QFutureInterface<bool>& interface)
|
|||||||
|
|
||||||
if (!m_runConfigure) {
|
if (!m_runConfigure) {
|
||||||
emit addOutput(tr("Configuration unchanged, skipping configure step."), BuildStep::MessageOutput);
|
emit addOutput(tr("Configuration unchanged, skipping configure step."), BuildStep::MessageOutput);
|
||||||
interface.reportResult(true);
|
reportRunResult(fi, true);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_runConfigure = false;
|
m_runConfigure = false;
|
||||||
AbstractProcessStep::run(interface);
|
AbstractProcessStep::run(fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStepConfigWidget *ConfigureStep::createConfigWidget()
|
BuildStepConfigWidget *ConfigureStep::createConfigWidget()
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
explicit ConfigureStep(ProjectExplorer::BuildStepList *bsl);
|
explicit ConfigureStep(ProjectExplorer::BuildStepList *bsl);
|
||||||
|
|
||||||
bool init(QList<const BuildStep *> &earlierSteps) override;
|
bool init(QList<const BuildStep *> &earlierSteps) override;
|
||||||
void run(QFutureInterface<bool> &interface) override;
|
void run(QFutureInterface<bool> &fi) override;
|
||||||
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
||||||
bool immutable() const override;
|
bool immutable() const override;
|
||||||
QString additionalArguments() const;
|
QString additionalArguments() const;
|
||||||
|
|||||||
@@ -83,8 +83,7 @@ void BareMetalGdbCommandsDeployStep::ctor()
|
|||||||
|
|
||||||
void BareMetalGdbCommandsDeployStep::run(QFutureInterface<bool> &fi)
|
void BareMetalGdbCommandsDeployStep::run(QFutureInterface<bool> &fi)
|
||||||
{
|
{
|
||||||
fi.reportResult(true);
|
reportRunResult(fi, true);
|
||||||
emit finished();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BareMetalGdbCommandsDeployStep::fromMap(const QVariantMap &map)
|
bool BareMetalGdbCommandsDeployStep::fromMap(const QVariantMap &map)
|
||||||
|
|||||||
@@ -236,9 +236,7 @@ void CMakeBuildStep::run(QFutureInterface<bool> &fi)
|
|||||||
m_runTrigger = connect(bc, &CMakeBuildConfiguration::dataAvailable,
|
m_runTrigger = connect(bc, &CMakeBuildConfiguration::dataAvailable,
|
||||||
this, [this, &fi]() { runImpl(fi); });
|
this, [this, &fi]() { runImpl(fi); });
|
||||||
m_errorTrigger = connect(bc, &CMakeBuildConfiguration::errorOccured,
|
m_errorTrigger = connect(bc, &CMakeBuildConfiguration::errorOccured,
|
||||||
this, [this, &fi]() {
|
this, [this, &fi]() { reportRunResult(fi, false); });
|
||||||
fi.reportResult(false);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
runImpl(fi);
|
runImpl(fi);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,9 +117,8 @@ void IosDeployStep::run(QFutureInterface<bool> &fi)
|
|||||||
if (iossimulator().isNull())
|
if (iossimulator().isNull())
|
||||||
TaskHub::addTask(Task::Error, tr("Deployment failed. No iOS device found."),
|
TaskHub::addTask(Task::Error, tr("Deployment failed. No iOS device found."),
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
||||||
m_futureInterface.reportResult(!iossimulator().isNull());
|
reportRunResult(m_futureInterface, !iossimulator().isNull());
|
||||||
cleanup();
|
cleanup();
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_transferStatus = TransferInProgress;
|
m_transferStatus = TransferInProgress;
|
||||||
@@ -179,7 +178,7 @@ void IosDeployStep::handleDidTransferApp(IosToolHandler *handler, const QString
|
|||||||
tr("Deployment failed. The settings in the Devices window of Xcode might be incorrect."),
|
tr("Deployment failed. The settings in the Devices window of Xcode might be incorrect."),
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
||||||
}
|
}
|
||||||
m_futureInterface.reportResult(status == IosToolHandler::Success);
|
reportRunResult(m_futureInterface, status == IosToolHandler::Success);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosDeployStep::handleFinished(IosToolHandler *handler)
|
void IosDeployStep::handleFinished(IosToolHandler *handler)
|
||||||
@@ -189,7 +188,7 @@ void IosDeployStep::handleFinished(IosToolHandler *handler)
|
|||||||
m_transferStatus = TransferFailed;
|
m_transferStatus = TransferFailed;
|
||||||
TaskHub::addTask(Task::Error, tr("Deployment failed."),
|
TaskHub::addTask(Task::Error, tr("Deployment failed."),
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
||||||
m_futureInterface.reportResult(false);
|
reportRunResult(m_futureInterface, false);
|
||||||
break;
|
break;
|
||||||
case NoTransfer:
|
case NoTransfer:
|
||||||
case TransferOk:
|
case TransferOk:
|
||||||
@@ -199,7 +198,6 @@ void IosDeployStep::handleFinished(IosToolHandler *handler)
|
|||||||
cleanup();
|
cleanup();
|
||||||
handler->deleteLater();
|
handler->deleteLater();
|
||||||
// move it when result is reported? (would need care to avoid problems with concurrent runs)
|
// move it when result is reported? (would need care to avoid problems with concurrent runs)
|
||||||
emit finished();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosDeployStep::handleErrorMsg(IosToolHandler *handler, const QString &msg)
|
void IosDeployStep::handleErrorMsg(IosToolHandler *handler, const QString &msg)
|
||||||
|
|||||||
@@ -187,8 +187,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
|||||||
emit addOutput(tr("Could not create directory \"%1\"")
|
emit addOutput(tr("Could not create directory \"%1\"")
|
||||||
.arg(QDir::toNativeSeparators(wd.absolutePath())),
|
.arg(QDir::toNativeSeparators(wd.absolutePath())),
|
||||||
BuildStep::ErrorMessageOutput);
|
BuildStep::ErrorMessageOutput);
|
||||||
fi.reportResult(false);
|
reportRunResult(fi, false);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,8 +195,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
|||||||
QString effectiveCommand = m_param.effectiveCommand();
|
QString effectiveCommand = m_param.effectiveCommand();
|
||||||
if (!QFileInfo::exists(effectiveCommand)) {
|
if (!QFileInfo::exists(effectiveCommand)) {
|
||||||
processStartupFailed();
|
processStartupFailed();
|
||||||
fi.reportResult(false);
|
reportRunResult(fi, false);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,8 +219,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
|||||||
processStartupFailed();
|
processStartupFailed();
|
||||||
delete m_process;
|
delete m_process;
|
||||||
m_process = nullptr;
|
m_process = nullptr;
|
||||||
fi.reportResult(false);
|
reportRunResult(fi, false);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
processStarted();
|
processStarted();
|
||||||
@@ -237,7 +234,7 @@ void AbstractProcessStep::cleanUp()
|
|||||||
{
|
{
|
||||||
// The process has finished, leftover data is read in processFinished
|
// The process has finished, leftover data is read in processFinished
|
||||||
processFinished(m_process->exitCode(), m_process->exitStatus());
|
processFinished(m_process->exitCode(), m_process->exitStatus());
|
||||||
bool returnValue = processSucceeded(m_process->exitCode(), m_process->exitStatus()) || m_ignoreReturnValue;
|
const bool returnValue = processSucceeded(m_process->exitCode(), m_process->exitStatus()) || m_ignoreReturnValue;
|
||||||
|
|
||||||
// Clean up output parsers
|
// Clean up output parsers
|
||||||
if (m_outputParserChain) {
|
if (m_outputParserChain) {
|
||||||
@@ -245,12 +242,13 @@ void AbstractProcessStep::cleanUp()
|
|||||||
m_outputParserChain = nullptr;
|
m_outputParserChain = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean up process
|
||||||
delete m_process;
|
delete m_process;
|
||||||
m_process = nullptr;
|
m_process = nullptr;
|
||||||
m_futureInterface->reportResult(returnValue);
|
|
||||||
m_futureInterface = nullptr;
|
|
||||||
|
|
||||||
emit finished();
|
// Report result
|
||||||
|
reportRunResult(*m_futureInterface, returnValue);
|
||||||
|
m_futureInterface = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -64,18 +64,21 @@ static QString msgProgress(int progress, int total)
|
|||||||
return BuildManager::tr("Finished %1 of %n steps", 0, total).arg(progress);
|
return BuildManager::tr("Finished %1 of %n steps", 0, total).arg(progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct BuildManagerPrivate
|
class BuildManagerPrivate
|
||||||
{
|
{
|
||||||
BuildManagerPrivate();
|
public:
|
||||||
|
Internal::CompileOutputWindow *m_outputWindow = nullptr;
|
||||||
Internal::CompileOutputWindow *m_outputWindow;
|
Internal::TaskWindow *m_taskWindow = nullptr;
|
||||||
TaskHub *m_taskHub;
|
|
||||||
Internal::TaskWindow *m_taskWindow;
|
|
||||||
|
|
||||||
QList<BuildStep *> m_buildQueue;
|
QList<BuildStep *> m_buildQueue;
|
||||||
QList<bool> m_enabledState;
|
QList<bool> m_enabledState;
|
||||||
QStringList m_stepNames;
|
QStringList m_stepNames;
|
||||||
bool m_running;
|
int m_progress = 0;
|
||||||
|
int m_maxProgress = 0;
|
||||||
|
bool m_running = false;
|
||||||
|
// is set to true while canceling, so that nextBuildStep knows that the BuildStep finished because of canceling
|
||||||
|
bool m_skipDisabled = false;
|
||||||
|
bool m_canceling = false;
|
||||||
QFutureWatcher<bool> m_watcher;
|
QFutureWatcher<bool> m_watcher;
|
||||||
QFutureInterface<bool> m_futureInterfaceForAysnc;
|
QFutureInterface<bool> m_futureInterfaceForAysnc;
|
||||||
BuildStep *m_currentBuildStep;
|
BuildStep *m_currentBuildStep;
|
||||||
@@ -84,31 +87,16 @@ struct BuildManagerPrivate
|
|||||||
QHash<Project *, int> m_activeBuildSteps;
|
QHash<Project *, int> m_activeBuildSteps;
|
||||||
QHash<Target *, int> m_activeBuildStepsPerTarget;
|
QHash<Target *, int> m_activeBuildStepsPerTarget;
|
||||||
QHash<ProjectConfiguration *, int> m_activeBuildStepsPerProjectConfiguration;
|
QHash<ProjectConfiguration *, int> m_activeBuildStepsPerProjectConfiguration;
|
||||||
Project *m_previousBuildStepProject;
|
Project *m_previousBuildStepProject = nullptr;
|
||||||
// is set to true while canceling, so that nextBuildStep knows that the BuildStep finished because of canceling
|
|
||||||
bool m_skipDisabled;
|
|
||||||
bool m_canceling;
|
|
||||||
|
|
||||||
// Progress reporting to the progress manager
|
// Progress reporting to the progress manager
|
||||||
int m_progress;
|
QFutureInterface<void> *m_progressFutureInterface = nullptr;
|
||||||
int m_maxProgress;
|
|
||||||
QFutureInterface<void> *m_progressFutureInterface;
|
|
||||||
QFutureWatcher<void> m_progressWatcher;
|
QFutureWatcher<void> m_progressWatcher;
|
||||||
QPointer<FutureProgress> m_futureProgress;
|
QPointer<FutureProgress> m_futureProgress;
|
||||||
|
|
||||||
QElapsedTimer m_elapsed;
|
QElapsedTimer m_elapsed;
|
||||||
};
|
};
|
||||||
|
|
||||||
BuildManagerPrivate::BuildManagerPrivate() :
|
|
||||||
m_running(false)
|
|
||||||
, m_previousBuildStepProject(0)
|
|
||||||
, m_skipDisabled(false)
|
|
||||||
, m_canceling(false)
|
|
||||||
, m_maxProgress(0)
|
|
||||||
, m_progressFutureInterface(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static BuildManagerPrivate *d = nullptr;
|
static BuildManagerPrivate *d = nullptr;
|
||||||
static BuildManager *m_instance = nullptr;
|
static BuildManager *m_instance = nullptr;
|
||||||
|
|
||||||
@@ -360,16 +348,10 @@ void BuildManager::addToOutputWindow(const QString &string, BuildStep::OutputFor
|
|||||||
d->m_outputWindow->appendText(stringToWrite, format);
|
d->m_outputWindow->appendText(stringToWrite, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildManager::buildStepFinishedAsync()
|
|
||||||
{
|
|
||||||
disconnect(d->m_currentBuildStep, &BuildStep::finished,
|
|
||||||
this, &BuildManager::buildStepFinishedAsync);
|
|
||||||
d->m_futureInterfaceForAysnc = QFutureInterface<bool>();
|
|
||||||
nextBuildQueue();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BuildManager::nextBuildQueue()
|
void BuildManager::nextBuildQueue()
|
||||||
{
|
{
|
||||||
|
d->m_futureInterfaceForAysnc = QFutureInterface<bool>();
|
||||||
|
|
||||||
d->m_outputWindow->flush();
|
d->m_outputWindow->flush();
|
||||||
if (d->m_canceling) {
|
if (d->m_canceling) {
|
||||||
d->m_canceling = false;
|
d->m_canceling = false;
|
||||||
@@ -391,8 +373,10 @@ void BuildManager::nextBuildQueue()
|
|||||||
d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, msgProgress(d->m_progress, d->m_maxProgress));
|
d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, msgProgress(d->m_progress, d->m_maxProgress));
|
||||||
decrementActiveBuildSteps(d->m_currentBuildStep);
|
decrementActiveBuildSteps(d->m_currentBuildStep);
|
||||||
|
|
||||||
bool result = d->m_skipDisabled || d->m_watcher.result();
|
const bool success = d->m_skipDisabled || d->m_watcher.result();
|
||||||
if (!result) {
|
if (success) {
|
||||||
|
nextStep();
|
||||||
|
} else {
|
||||||
// Build Failure
|
// Build Failure
|
||||||
Target *t = d->m_currentBuildStep->target();
|
Target *t = d->m_currentBuildStep->target();
|
||||||
const QString projectName = d->m_currentBuildStep->project()->displayName();
|
const QString projectName = d->m_currentBuildStep->project()->displayName();
|
||||||
@@ -406,12 +390,9 @@ void BuildManager::nextBuildQueue()
|
|||||||
addToOutputWindow(tr("When executing step \"%1\"").arg(d->m_currentBuildStep->displayName()), BuildStep::ErrorOutput);
|
addToOutputWindow(tr("When executing step \"%1\"").arg(d->m_currentBuildStep->displayName()), BuildStep::ErrorOutput);
|
||||||
// NBS TODO fix in qtconcurrent
|
// NBS TODO fix in qtconcurrent
|
||||||
d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName));
|
d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName));
|
||||||
}
|
|
||||||
|
|
||||||
if (result)
|
|
||||||
nextStep();
|
|
||||||
else
|
|
||||||
clearBuildQueue();
|
clearBuildQueue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildManager::progressChanged()
|
void BuildManager::progressChanged()
|
||||||
@@ -463,8 +444,6 @@ void BuildManager::nextStep()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (d->m_currentBuildStep->runInGuiThread()) {
|
if (d->m_currentBuildStep->runInGuiThread()) {
|
||||||
connect(d->m_currentBuildStep, &BuildStep::finished,
|
|
||||||
m_instance, &BuildManager::buildStepFinishedAsync);
|
|
||||||
d->m_watcher.setFuture(d->m_futureInterfaceForAysnc.future());
|
d->m_watcher.setFuture(d->m_futureInterfaceForAysnc.future());
|
||||||
d->m_currentBuildStep->run(d->m_futureInterfaceForAysnc);
|
d->m_currentBuildStep->run(d->m_futureInterfaceForAysnc);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ private:
|
|||||||
static void addToOutputWindow(const QString &string, BuildStep::OutputFormat format,
|
static void addToOutputWindow(const QString &string, BuildStep::OutputFormat format,
|
||||||
BuildStep::OutputNewlineSetting newlineSettings = BuildStep::DoAppendNewline);
|
BuildStep::OutputNewlineSetting newlineSettings = BuildStep::DoAppendNewline);
|
||||||
|
|
||||||
void buildStepFinishedAsync();
|
|
||||||
static void nextBuildQueue();
|
static void nextBuildQueue();
|
||||||
static void progressChanged();
|
static void progressChanged();
|
||||||
static void progressTextChanged();
|
static void progressTextChanged();
|
||||||
|
|||||||
@@ -160,6 +160,12 @@ Project *BuildStep::project() const
|
|||||||
return target()->project();
|
return target()->project();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BuildStep::reportRunResult(QFutureInterface<bool> &fi, bool success)
|
||||||
|
{
|
||||||
|
fi.reportResult(success);
|
||||||
|
fi.reportFinished();
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
If this function returns \c true, the user cannot delete this build step for
|
If this function returns \c true, the user cannot delete this build step for
|
||||||
this target and the user is prevented from changing the order in which
|
this target and the user is prevented from changing the order in which
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ public:
|
|||||||
enum OutputFormat { NormalOutput, ErrorOutput, MessageOutput, ErrorMessageOutput };
|
enum OutputFormat { NormalOutput, ErrorOutput, MessageOutput, ErrorMessageOutput };
|
||||||
enum OutputNewlineSetting { DoAppendNewline, DontAppendNewline };
|
enum OutputNewlineSetting { DoAppendNewline, DontAppendNewline };
|
||||||
|
|
||||||
|
static void reportRunResult(QFutureInterface<bool> &fi, bool success);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/// Adds a \p task to the Issues pane.
|
/// Adds a \p task to the Issues pane.
|
||||||
/// Do note that for linking compile output with tasks, you should first emit the task
|
/// Do note that for linking compile output with tasks, you should first emit the task
|
||||||
@@ -86,8 +88,6 @@ signals:
|
|||||||
void addOutput(const QString &string, ProjectExplorer::BuildStep::OutputFormat format,
|
void addOutput(const QString &string, ProjectExplorer::BuildStep::OutputFormat format,
|
||||||
ProjectExplorer::BuildStep::OutputNewlineSetting newlineSetting = DoAppendNewline);
|
ProjectExplorer::BuildStep::OutputNewlineSetting newlineSetting = DoAppendNewline);
|
||||||
|
|
||||||
void finished();
|
|
||||||
|
|
||||||
void enabledChanged();
|
void enabledChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ bool DeviceCheckBuildStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
|
|
||||||
void DeviceCheckBuildStep::run(QFutureInterface<bool> &fi)
|
void DeviceCheckBuildStep::run(QFutureInterface<bool> &fi)
|
||||||
{
|
{
|
||||||
fi.reportResult(true);
|
reportRunResult(fi, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStepConfigWidget *DeviceCheckBuildStep::createConfigWidget()
|
BuildStepConfigWidget *DeviceCheckBuildStep::createConfigWidget()
|
||||||
|
|||||||
@@ -408,8 +408,7 @@ void QbsBuildStep::build()
|
|||||||
m_job = qbsProject()->build(options, m_products, error);
|
m_job = qbsProject()->build(options, m_products, error);
|
||||||
if (!m_job) {
|
if (!m_job) {
|
||||||
emit addOutput(error, ErrorMessageOutput);
|
emit addOutput(error, ErrorMessageOutput);
|
||||||
m_fi->reportResult(false);
|
reportRunResult(*m_fi, false);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,14 +429,12 @@ void QbsBuildStep::build()
|
|||||||
void QbsBuildStep::finish()
|
void QbsBuildStep::finish()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_fi, return);
|
QTC_ASSERT(m_fi, return);
|
||||||
m_fi->reportResult(m_lastWasSuccess);
|
reportRunResult(*m_fi, m_lastWasSuccess);
|
||||||
m_fi = 0; // do not delete, it is not ours
|
m_fi = 0; // do not delete, it is not ours
|
||||||
if (m_job) {
|
if (m_job) {
|
||||||
m_job->deleteLater();
|
m_job->deleteLater();
|
||||||
m_job = 0;
|
m_job = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit finished();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QbsProject *QbsBuildStep::qbsProject() const
|
QbsProject *QbsBuildStep::qbsProject() const
|
||||||
|
|||||||
@@ -100,8 +100,7 @@ void QbsCleanStep::run(QFutureInterface<bool> &fi)
|
|||||||
m_job = pro->clean(options);
|
m_job = pro->clean(options);
|
||||||
|
|
||||||
if (!m_job) {
|
if (!m_job) {
|
||||||
m_fi->reportResult(false);
|
reportRunResult(*m_fi, false);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,12 +174,10 @@ void QbsCleanStep::cleaningDone(bool success)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTC_ASSERT(m_fi, return);
|
QTC_ASSERT(m_fi, return);
|
||||||
m_fi->reportResult(success);
|
reportRunResult(*m_fi, success);
|
||||||
m_fi = 0; // do not delete, it is not ours
|
m_fi = 0; // do not delete, it is not ours
|
||||||
m_job->deleteLater();
|
m_job->deleteLater();
|
||||||
m_job = 0;
|
m_job = 0;
|
||||||
|
|
||||||
emit finished();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsCleanStep::handleTaskStarted(const QString &desciption, int max)
|
void QbsCleanStep::handleTaskStarted(const QString &desciption, int max)
|
||||||
|
|||||||
@@ -93,8 +93,7 @@ void QbsInstallStep::run(QFutureInterface<bool> &fi)
|
|||||||
m_job = pro->install(m_qbsInstallOptions);
|
m_job = pro->install(m_qbsInstallOptions);
|
||||||
|
|
||||||
if (!m_job) {
|
if (!m_job) {
|
||||||
m_fi->reportResult(false);
|
reportRunResult(*m_fi, false);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,12 +192,10 @@ void QbsInstallStep::installDone(bool success)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTC_ASSERT(m_fi, return);
|
QTC_ASSERT(m_fi, return);
|
||||||
m_fi->reportResult(success);
|
reportRunResult(*m_fi, success);
|
||||||
m_fi = 0; // do not delete, it is not ours
|
m_fi = 0; // do not delete, it is not ours
|
||||||
m_job->deleteLater();
|
m_job->deleteLater();
|
||||||
m_job = 0;
|
m_job = 0;
|
||||||
|
|
||||||
emit finished();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsInstallStep::handleTaskStarted(const QString &desciption, int max)
|
void QbsInstallStep::handleTaskStarted(const QString &desciption, int max)
|
||||||
|
|||||||
@@ -105,8 +105,7 @@ void AndroidPackageInstallationStep::run(QFutureInterface<bool> &fi)
|
|||||||
emit addOutput(tr("Removing directory %1").arg(dir), MessageOutput);
|
emit addOutput(tr("Removing directory %1").arg(dir), MessageOutput);
|
||||||
if (!Utils::FileUtils::removeRecursively(androidDir, &error)) {
|
if (!Utils::FileUtils::removeRecursively(androidDir, &error)) {
|
||||||
emit addOutput(error, ErrorOutput);
|
emit addOutput(error, ErrorOutput);
|
||||||
fi.reportResult(false);
|
reportRunResult(fi, false);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -269,8 +269,7 @@ void QmakeAndroidBuildApkStep::run(QFutureInterface<bool> &fi)
|
|||||||
{
|
{
|
||||||
if (m_skipBuilding) {
|
if (m_skipBuilding) {
|
||||||
emit addOutput(tr("No application .pro file found, not building an APK."), BuildStep::ErrorMessageOutput);
|
emit addOutput(tr("No application .pro file found, not building an APK."), BuildStep::ErrorMessageOutput);
|
||||||
fi.reportResult(true);
|
reportRunResult(fi, true);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AndroidBuildApkStep::run(fi);
|
AndroidBuildApkStep::run(fi);
|
||||||
|
|||||||
@@ -265,16 +265,15 @@ bool MakeStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
void MakeStep::run(QFutureInterface<bool> & fi)
|
void MakeStep::run(QFutureInterface<bool> & fi)
|
||||||
{
|
{
|
||||||
if (m_scriptTarget) {
|
if (m_scriptTarget) {
|
||||||
fi.reportResult(true);
|
reportRunResult(fi, true);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!QFileInfo::exists(m_makeFileToCheck)) {
|
if (!QFileInfo::exists(m_makeFileToCheck)) {
|
||||||
if (!ignoreReturnValue())
|
if (!ignoreReturnValue())
|
||||||
emit addOutput(tr("Cannot find Makefile. Check your build settings."), BuildStep::MessageOutput);
|
emit addOutput(tr("Cannot find Makefile. Check your build settings."), BuildStep::MessageOutput);
|
||||||
fi.reportResult(ignoreReturnValue());
|
const bool success = ignoreReturnValue();
|
||||||
emit finished();
|
reportRunResult(fi, success);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -250,14 +250,13 @@ bool QMakeStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
void QMakeStep::run(QFutureInterface<bool> &fi)
|
void QMakeStep::run(QFutureInterface<bool> &fi)
|
||||||
{
|
{
|
||||||
if (m_scriptTemplate) {
|
if (m_scriptTemplate) {
|
||||||
fi.reportResult(true);
|
reportRunResult(fi, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_needToRunQMake) {
|
if (!m_needToRunQMake) {
|
||||||
emit addOutput(tr("Configuration unchanged, skipping qmake step."), BuildStep::MessageOutput);
|
emit addOutput(tr("Configuration unchanged, skipping qmake step."), BuildStep::MessageOutput);
|
||||||
fi.reportResult(true);
|
reportRunResult(fi, true);
|
||||||
emit finished();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -610,7 +609,7 @@ void QMakeStepConfigWidget::askForRebuild()
|
|||||||
question->setText(tr("The option will only take effect if the project is recompiled. Do you want to recompile now?"));
|
question->setText(tr("The option will only take effect if the project is recompiled. Do you want to recompile now?"));
|
||||||
question->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
question->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||||
question->setModal(true);
|
question->setModal(true);
|
||||||
connect(question, SIGNAL(finished(int)), this, SLOT(recompileMessageBoxFinished(int)));
|
connect(question, &QDialog::finished, this, &QMakeStepConfigWidget::recompileMessageBoxFinished);
|
||||||
question->show();
|
question->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,8 +149,7 @@ void AbstractRemoteLinuxDeployStep::handleFinished()
|
|||||||
else
|
else
|
||||||
emit addOutput(tr("Deploy step finished."), MessageOutput);
|
emit addOutput(tr("Deploy step finished."), MessageOutput);
|
||||||
disconnect(deployService(), 0, this, 0);
|
disconnect(deployService(), 0, this, 0);
|
||||||
d->future.reportResult(!d->hasError);
|
reportRunResult(d->future, !d->hasError);
|
||||||
emit finished();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractRemoteLinuxDeployStep::handleStdOutData(const QString &data)
|
void AbstractRemoteLinuxDeployStep::handleStdOutData(const QString &data)
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ void TarPackageCreationStep::run(QFutureInterface<bool> &fi)
|
|||||||
emit addOutput(tr("Packaging finished successfully."), MessageOutput);
|
emit addOutput(tr("Packaging finished successfully."), MessageOutput);
|
||||||
else
|
else
|
||||||
emit addOutput(tr("Packaging failed."), ErrorMessageOutput);
|
emit addOutput(tr("Packaging failed."), ErrorMessageOutput);
|
||||||
fi.reportResult(success);
|
reportRunResult(fi, success);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TarPackageCreationStep::setIgnoreMissingFiles(bool ignoreMissingFiles)
|
void TarPackageCreationStep::setIgnoreMissingFiles(bool ignoreMissingFiles)
|
||||||
|
|||||||
Reference in New Issue
Block a user