Skip to content

Commit 97dec86

Browse files
authored
Add defaultEnvironments settings to settings docs (#37)
1 parent 172eeb2 commit 97dec86

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

views/settings.dt

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ block body
3434
li <code>$ROOT_PACKAGE_DIR/dub.settings.json</code>
3535

3636
h3 Settings overview
37+
38+
// implementation: https://github.com/dlang/dub/blob/27908126db37c01435110143971904a0b32303b6/source/dub/dub.d#L1903
3739

3840
table
3941
tr
@@ -82,3 +84,60 @@ block body
8284
td defaultLowMemory
8385
td: code bool
8486
td Enable the garbage collector for the compiler(dmd/ldc), reducing the compiler memory requirements but increasing compile times.
87+
88+
tr
89+
td defaultEnvironments
90+
td: code string[string]
91+
td Sets the keys in environments if they are not overriden by the dub recipe. Defines default environment variables used by all executable invocations. This has the lowest precedence.
92+
93+
tr
94+
td defaultBuildEnvironments
95+
td: code string[string]
96+
td Sets the keys in buildEnvironments if they are not overriden by the dub recipe. Defines default environment variables used by build tools (compiler, linker), preBuildCommands, postBuildCommands, preGenerateCommands and postGenerateCommands invocations. Overrides keys from defaultEnvironments.
97+
98+
tr
99+
td defaultRunEnvironments
100+
td: code string[string]
101+
td Sets the keys in runEnvironments if they are not overriden by the dub recipe. Defines default environment variables used by the built user program, preRunCommands and postRunCommands invocations. Overrides keys from defaultEnvironments.
102+
103+
tr
104+
td defaultPreGenerateEnvironments
105+
td: code string[string]
106+
td Sets the keys in preGenerateEnvironments if they are not overriden by the dub recipe. Defines default environment variables used by preGenerateCommands invocations. Overrides keys from defaultEnvironments.
107+
108+
tr
109+
td defaultPostGenerateEnvironments
110+
td: code string[string]
111+
td Sets the keys in postGenerateEnvironments if they are not overriden by the dub recipe. Defines default environment variables used by postGenerateCommands invocations. Overrides keys from defaultEnvironments.
112+
113+
tr
114+
td defaultPreBuildEnvironments
115+
td: code string[string]
116+
td Sets the keys in preBuildEnvironments if they are not overriden by the dub recipe. Defines default environment variables used by preBuildCommands invocations. Overrides keys from defaultBuildEnvironments and defaultEnvironments.
117+
118+
tr
119+
td defaultPostBuildEnvironments
120+
td: code string[string]
121+
td Sets the keys in postBuildEnvironments if they are not overriden by the dub recipe. Defines default environment variables used by postBuildCommands invocations. Overrides keys from defaultBuildEnvironments and defaultEnvironments.
122+
123+
tr
124+
td defaultPreRunEnvironments
125+
td: code string[string]
126+
td Sets the keys in preRunEnvironments if they are not overriden by the dub recipe. Defines default environment variables used by preRunCommands invocations. Overrides keys from defaultRunEnvironments and defaultEnvironments.
127+
128+
tr
129+
td defaultPostRunEnvironments
130+
td: code string[string]
131+
td Sets the keys in postRunEnvironments if they are not overriden by the dub recipe. Defines default environment variables used by postRunCommands invocations. Overrides keys from defaultRunEnvironments and defaultEnvironments.
132+
133+
h3 Environment Variables
134+
135+
// test case: https://github.com/dlang/dub/blob/master/test/environment-variables.script.d#L10
136+
137+
p Environment variables are set by keys using the defaultEnvironments and related settings in the settings and with highest precedence environments and related settings in the package recipe.
138+
139+
p For finding the default environment variables first the system environment variables are loaded, then overriden by the settings environment variables. This goes through all the default settings first.
140+
141+
p Afterwards dependency or recipe environment variables override these default environment variables. Recipe variables have higher precedence than dependency variables.
142+
143+
p Defining a generic environments block inside a dependency overrides the keys set by e.g. defaultPreRunEnvironments inside the settings.

0 commit comments

Comments
 (0)