Skip to content

Feature Request: Allow for specifying custom build environment variables #141

Description

@fourpastmidnight

I have a requirement where I need to "compose" my project together, and therefore, the "output path" is where the composed output is placed. Then, there's the real output path of my published "package". It would be nice if, when invoking Set-BuildEnvironment, one could add their own custom variable, something along the lines of:

Set-BuildEnvironment `
    -VariableNamePrefix 'MYPROJECT_' `
    -BuildOutput '$ProjectRoot\build' `
    -CustomVariables @{ 'BUILDARTIFACTS' = '$ProjectRoot\out' }

(NOTE: It's OK to have a plural parameter name when the value of the parameter is a hashtable, where there may be 1 or more items. This is a rare exception to the rule that parameter names should be singular. See, for example, Invoke-RestMethod and its parameter -Headers.)

In the "custom variable" hashtable, you only need to define the variable name and it's value. The name will be pre-pended with the VariableNamePrefix, if any, resulting in this case, the environment variable MYPROJECT_BUILDARTIFACTS being defined. And for the value, you can use the same syntax as we are already accustomed to for ensuring variables are "expanded" appropriately (e.g., $ProjectRoot).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions