From 4672624bdcdee69b313f82f4d0a6d86353af8315 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 25 Jan 2017 16:15:54 +0100 Subject: [PATCH] ProjectExplorer: Add CurrentBuild:Env to the MacroExpander Make BuildConfigurations provide %{CurrentBuild:Env:VARNAME} via the macro expander infrastructure. Change-Id: I1bed8c6aa9003c361a07fa69a5a3840f7a4e0d17 Reviewed-by: Tim Jenssen --- src/plugins/projectexplorer/buildconfiguration.cpp | 7 +++++-- src/plugins/projectexplorer/projectexplorerconstants.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index ec3cf9894f9..3464c033f64 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -104,9 +104,12 @@ void BuildConfiguration::ctor() expander->registerVariable("buildDir", tr("Build directory"), [this] { return buildDirectory().toUserOutput(); }); - expander->registerVariable(Constants::VAR_CURRENTBUILD_NAME, - QCoreApplication::translate("ProjectExplorer", "Name of current build"), + expander->registerVariable(Constants::VAR_CURRENTBUILD_NAME, tr("Name of current build"), [this] { return displayName(); }, false); + + expander->registerPrefix(Constants::VAR_CURRENTBUILD_ENV, + tr("Variables in the current build environment"), + [this](const QString &var) { return environment().value(var); }); } Utils::FileName BuildConfiguration::buildDirectory() const diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index dab1f51f25c..c1c078b6082 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -244,6 +244,7 @@ const char VAR_CURRENTKIT_FILESYSTEMNAME[] = "CurrentKit:FileSystemName"; const char VAR_CURRENTKIT_ID[] = "CurrentKit:Id"; const char VAR_CURRENTBUILD_NAME[] = "CurrentBuild:Name"; const char VAR_CURRENTBUILD_TYPE[] = "CurrentBuild:Type"; +const char VAR_CURRENTBUILD_ENV[] = "CurrentBuild:Env"; const char VAR_CURRENTRUN_NAME[] = "CurrentRun:Name"; const char VAR_CURRENTRUN_EXECUTABLE_PREFIX[] = "CurrentRun:Executable"; const char VAR_CURRENTDEVICE_HOSTADDRESS[] = "CurrentDevice:HostAddress";