diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-11-13 12:19:35 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-11-16 14:04:59 +0000 |
commit | 79f82d0d0ae9fffb4daebdc10bc1abe1761b99e1 (patch) | |
tree | 3ea76f0fada59fb3203240e8a05d39661cf62464 /src/plugins/projectexplorer | |
parent | cedf015c10cae35738ff7651389c660f101d0e98 (diff) | |
download | qt-creator-79f82d0d0ae9fffb4daebdc10bc1abe1761b99e1.tar.gz |
BuildManager: Provide context of earlier build steps to init
This information can be used to get information from earlier steps,
which e.g. queried for android devices to deploy to.
Change-Id: Iefe1c9443915cb6211f86f98ff7aaf3cb75145ba
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'src/plugins/projectexplorer')
8 files changed, 13 insertions, 9 deletions
diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 29b5e90184..8fc5315274 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -178,8 +178,9 @@ void AbstractProcessStep::setIgnoreReturnValue(bool b) YourBuildStep::init(). */ -bool AbstractProcessStep::init() +bool AbstractProcessStep::init(QList<const BuildStep *> &earlierSteps) { + Q_UNUSED(earlierSteps); return true; } diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index c329c6892b..b086545f67 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -54,7 +54,7 @@ class PROJECTEXPLORER_EXPORT AbstractProcessStep : public BuildStep public: ~AbstractProcessStep() override; - bool init() override; + bool init(QList<const BuildStep *> &earlierSteps) override; void run(QFutureInterface<bool> &) override; bool runInGuiThread() const override { return true; } diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 4d8db4520f..0e363beb0a 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -491,6 +491,7 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps, QStringList names, addToOutputWindow(str, BuildStep::MessageOutput, BuildStep::DontAppendNewline); } + QList<const BuildStep *> earlierSteps; int count = steps.size(); bool init = true; int i = 0; @@ -501,9 +502,10 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps, QStringList names, connect(bs, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat,ProjectExplorer::BuildStep::OutputNewlineSetting)), m_instance, SLOT(addToOutputWindow(QString,ProjectExplorer::BuildStep::OutputFormat,ProjectExplorer::BuildStep::OutputNewlineSetting))); if (bs->enabled()) { - init = bs->init(); + init = bs->init(earlierSteps); if (!init) break; + earlierSteps.append(bs); } } if (!init) { diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 43ae9aef02..a2f065da6f 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -56,7 +56,7 @@ protected: BuildStep(BuildStepList *bsl, BuildStep *bs); public: - virtual bool init() = 0; + virtual bool init(QList<const BuildStep *> &earlierSteps) = 0; virtual void run(QFutureInterface<bool> &fi) = 0; diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp index 0cc4320789..3e8f558cad 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp @@ -54,8 +54,9 @@ DeviceCheckBuildStep::DeviceCheckBuildStep(BuildStepList *bsl, DeviceCheckBuildS setDefaultDisplayName(stepDisplayName()); } -bool DeviceCheckBuildStep::init() +bool DeviceCheckBuildStep::init(QList<const BuildStep *> &earlierSteps) { + Q_UNUSED(earlierSteps); IDevice::ConstPtr device = DeviceKitInformation::device(target()->kit()); if (!device) { Core::Id deviceTypeId = DeviceTypeKitInformation::deviceTypeId(target()->kit()); diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h index 5c4617735d..d50cd73cb4 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h @@ -47,7 +47,7 @@ public: DeviceCheckBuildStep(BuildStepList *bsl, Core::Id id); DeviceCheckBuildStep(BuildStepList *bsl, DeviceCheckBuildStep *bs); - bool init() override; + bool init(QList<const BuildStep *> &earlierSteps) override; void run(QFutureInterface<bool> &fi) override; diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index 8d20363c7c..707fc66c53 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -72,7 +72,7 @@ void ProcessStep::ctor() m_workingDirectory = QLatin1String(Constants::DEFAULT_WORKING_DIR); } -bool ProcessStep::init() +bool ProcessStep::init(QList<const BuildStep *> &earlierSteps) { BuildConfiguration *bc = buildConfiguration(); if (!bc) @@ -86,7 +86,7 @@ bool ProcessStep::init() pp->resolveAll(); setOutputParser(target()->kit()->createOutputParser()); - return AbstractProcessStep::init(); + return AbstractProcessStep::init(earlierSteps); } void ProcessStep::run(QFutureInterface<bool> & fi) diff --git a/src/plugins/projectexplorer/processstep.h b/src/plugins/projectexplorer/processstep.h index 9360fa921f..61a0462141 100644 --- a/src/plugins/projectexplorer/processstep.h +++ b/src/plugins/projectexplorer/processstep.h @@ -65,7 +65,7 @@ class ProcessStep : public AbstractProcessStep public: explicit ProcessStep(BuildStepList *bsl); - bool init() override; + bool init(QList<const BuildStep *> &earlierSteps) override; void run(QFutureInterface<bool> &) override; BuildStepConfigWidget *createConfigWidget() override; |