Skip to content

Commit b5fc65c

Browse files
authored
Ensure environment from settings is added to resolved tasks (#1429)
The environment in the task.json definitions was not adding workspace/global env settings. Layer in the `swiftEnvironmentVariables` the same way as in generated build tasks.
1 parent e0f9531 commit b5fc65c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/tasks/SwiftTaskProvider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ export class SwiftTaskProvider implements vscode.TaskProvider {
439439
const args = platform?.args ?? task.definition.args;
440440
const env = platform?.env ?? task.definition.env;
441441
const fullCwd = resolveTaskCwd(task, platform?.cwd ?? task.definition.cwd);
442+
const fullEnv = {
443+
...configuration.swiftEnvironmentVariables,
444+
...swiftRuntimeEnv(),
445+
...env,
446+
};
442447

443448
const presentation = task.definition.presentation ?? task.presentationOptions ?? {};
444449
const newTask = new vscode.Task(
@@ -448,7 +453,7 @@ export class SwiftTaskProvider implements vscode.TaskProvider {
448453
"swift",
449454
new SwiftExecution(swift, args, {
450455
cwd: fullCwd,
451-
env: { ...env, ...swiftRuntimeEnv() },
456+
env: fullEnv,
452457
presentation,
453458
}),
454459
task.problemMatchers

0 commit comments

Comments
 (0)