Environment Variables plugin

From Code::Blocks
Environment Variables Editor
Envvars.png
Developer(s): MortenMacFly
Maintainer(s): MortenMacFly
Version: 0.97

Environment variables editor plugin allows for the setting of system environment variables in the focus of Code::Blocks. A user can have several sets that contain 1..n environment variables. A user can switch between these sets within the environment variables configuration dialog. In addition the EnvVars plugin offers an option to projects (within project setup) to apply a certain EnvVar set to activate (and use during compilation).

The dialog for editing the sets is located in Settings->Environment->Environment variables.
The dialog for choosing the active set for the current project is located in Project->Properties->EnvVar options.

Script binding

This plugin provides its functionality through a squirrel binding:

Return value Name Arguments Remarks
wxArrayString EnvvarGetEnvvarSetNames Returns all envvars sets available
wxString EnvvarGetActiveSetName Returns the name of the currently active set (from config, /active_set)
wxArrayString EnvVarGetEnvvarsBySetPath const wxString set_name Returns the envvars of an envvars set path in the config
bool EnvvarSetExists const wxString set_name Verifies if an envvars set really exists in the config
bool EnvvarSetApply const wxString& set_name, bool even_if_active Applies a specific envvar set from the config (without UI interaction)
void EnvvarSetDiscard const wxString Discards a specific envvar set from the config (without UI interaction)
bool EnvvarApply const wxString key, const wxString value Applies a specific envvar
bool EnvvarDiscard const wxString key Discards an envvar

NOTE: The value arguments are automatically expanded from macros. You do not have to call ReplaceMacros() on them

Example

On windows in the post or pre build steps:

[[EnvvarApply(_("test"),_("testValue"));]]
echo %test%

See also