Commit 74e570a8 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Qmake: Add variable choosers where variables are parsed



Change-Id: I6203ebadbc934a7ae80ae1c5ca3cfad2471b787e
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 75538aa0
...@@ -262,7 +262,7 @@ void MakeStepConfigWidget::updateDetails() ...@@ -262,7 +262,7 @@ void MakeStepConfigWidget::updateDetails()
Utils::QtcProcess::addArgs(&arguments, m_makeStep->additionalArguments()); Utils::QtcProcess::addArgs(&arguments, m_makeStep->additionalArguments());
ProcessParameters param; ProcessParameters param;
param.setMacroExpander(bc->macroExpander()); param.setMacroExpander(m_makeStep->macroExpander());
param.setEnvironment(bc->environment()); param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory().toString()); param.setWorkingDirectory(bc->buildDirectory().toString());
param.setCommand(tcList.at(0)->makeCommand(bc->environment())); param.setCommand(tcList.at(0)->makeCommand(bc->environment()));
......
...@@ -115,6 +115,7 @@ BuildStep::BuildStep(BuildStepList *bsl, Core::Id id) : ...@@ -115,6 +115,7 @@ BuildStep::BuildStep(BuildStepList *bsl, Core::Id id) :
ProjectConfiguration(bsl, id), m_enabled(true) ProjectConfiguration(bsl, id), m_enabled(true)
{ {
Q_ASSERT(bsl); Q_ASSERT(bsl);
ctor();
} }
BuildStep::BuildStep(BuildStepList *bsl, BuildStep *bs) : BuildStep::BuildStep(BuildStepList *bsl, BuildStep *bs) :
...@@ -122,6 +123,15 @@ BuildStep::BuildStep(BuildStepList *bsl, BuildStep *bs) : ...@@ -122,6 +123,15 @@ BuildStep::BuildStep(BuildStepList *bsl, BuildStep *bs) :
{ {
Q_ASSERT(bsl); Q_ASSERT(bsl);
setDisplayName(bs->displayName()); setDisplayName(bs->displayName());
ctor();
}
void BuildStep::ctor()
{
Utils::MacroExpander *expander = macroExpander();
expander->setDisplayName(tr("Build Step"));
expander->setAccumulating(true);
expander->registerSubProvider([this] { return projectConfiguration()->macroExpander(); });
} }
bool BuildStep::fromMap(const QVariantMap &map) bool BuildStep::fromMap(const QVariantMap &map)
......
...@@ -95,6 +95,8 @@ signals: ...@@ -95,6 +95,8 @@ signals:
void enabledChanged(); void enabledChanged();
private: private:
void ctor();
bool m_enabled; bool m_enabled;
}; };
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "target.h" #include "target.h"
#include "kit.h" #include "kit.h"
#include <coreplugin/variablechooser.h>
#include <utils/macroexpander.h> #include <utils/macroexpander.h>
#include <QDebug> #include <QDebug>
...@@ -204,6 +206,7 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) : ...@@ -204,6 +206,7 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) :
connect(m_ui.commandArgumentsLineEdit, &QLineEdit::textEdited, connect(m_ui.commandArgumentsLineEdit, &QLineEdit::textEdited,
this, &ProcessStepConfigWidget::commandArgumentsLineEditTextEdited); this, &ProcessStepConfigWidget::commandArgumentsLineEditTextEdited);
Core::VariableChooser::addSupportForChildWidgets(this, m_step->macroExpander());
} }
void ProcessStepConfigWidget::updateDetails() void ProcessStepConfigWidget::updateDetails()
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "qmakebuildconfiguration.h" #include "qmakebuildconfiguration.h"
#include "qmakeprojectmanagerconstants.h" #include "qmakeprojectmanagerconstants.h"
#include <coreplugin/variablechooser.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h> #include <projectexplorer/toolchain.h>
#include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsteplist.h>
...@@ -357,6 +358,8 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep) ...@@ -357,6 +358,8 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged, connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
this, &MakeStepConfigWidget::updateDetails); this, &MakeStepConfigWidget::updateDetails);
connect(m_makeStep->target(), &Target::kitChanged, this, &MakeStepConfigWidget::updateDetails); connect(m_makeStep->target(), &Target::kitChanged, this, &MakeStepConfigWidget::updateDetails);
Core::VariableChooser::addSupportForChildWidgets(this, m_makeStep->macroExpander());
} }
void MakeStepConfigWidget::activeBuildConfigurationChanged() void MakeStepConfigWidget::activeBuildConfigurationChanged()
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/icontext.h> #include <coreplugin/icontext.h>
#include <coreplugin/variablechooser.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtversionmanager.h> #include <qtsupport/qtversionmanager.h>
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>
...@@ -634,6 +635,9 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step) ...@@ -634,6 +635,9 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
connect(step->target(), &Target::kitChanged, this, &QMakeStepConfigWidget::qtVersionChanged); connect(step->target(), &Target::kitChanged, this, &QMakeStepConfigWidget::qtVersionChanged);
connect(QtVersionManager::instance(), &QtVersionManager::dumpUpdatedFor, connect(QtVersionManager::instance(), &QtVersionManager::dumpUpdatedFor,
this, &QMakeStepConfigWidget::qtVersionChanged); this, &QMakeStepConfigWidget::qtVersionChanged);
auto chooser = new Core::VariableChooser(m_ui->qmakeAdditonalArgumentsLineEdit);
chooser->addMacroExpanderProvider([step] { return step->macroExpander(); });
chooser->addSupportedWidget(m_ui->qmakeAdditonalArgumentsLineEdit);
} }
QMakeStepConfigWidget::~QMakeStepConfigWidget() QMakeStepConfigWidget::~QMakeStepConfigWidget()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment