move command variable substitution to execution
This is needed as commands that need to be run need to have generator
settings available before running to avoid inconsistencies with
environment variables passed to the actually ran program and variables
used in substitution.

Fixes #2192

Fixes pre/postGenerateCommands inconsistently using dub environments
(execution was substituted including buildEnvironments, but shell cmd
did not get the build variables for substitution) - now both get
the build variables. Solved by removing code duplication. (env building)

This commit changes the behavior of `dub describe` so that describing
commands settings no longer substitutes variables. Before, known
variables would have been replaced in the output and on unknown
variables `dub describe` would fail with an error
`Target 'x' doesn't exist`

Now exposes some previously private project.d processVars functions
1 parent 7ee2cbe commit 6c21e598a61a5f5561409d526591101f111d0d3d
@WebFreak001 WebFreak001 authored on 13 Feb 2022
Jan Jurzitza committed on 14 Feb 2022
Showing 9 changed files
View
changelog/command-variables.dd 0 → 100644
View
source/dub/description.d
View
source/dub/generators/build.d
View
source/dub/generators/generator.d
View
source/dub/project.d
View
test/issue2192-environment-variables.sh 0 → 100755
View
test/issue2192-environment-variables/.no_run 0 → 100644
View
test/issue2192-environment-variables/dub.sdl 0 → 100644
View
test/issue2192-environment-variables/source/lib.d 0 → 100644