Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fourpastmidnight opened this issue Aug 11, 2023 · 0 comments · May be fixed by #142
Open

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

fourpastmidnight opened this issue Aug 11, 2023 · 0 comments · May be fixed by #142

Comments

@fourpastmidnight
Copy link
Contributor

fourpastmidnight commented Aug 11, 2023

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).

@fourpastmidnight fourpastmidnight linked a pull request Aug 11, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant