From 7f4fc50dfb21b2aaa8683fde549191b8cda8000b Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Wed, 13 Nov 2024 11:53:59 -0500 Subject: [PATCH] =?UTF-8?q?fix(core):=20create=20different=20dummy=20tasks?= =?UTF-8?q?=20for=20different=20parent=20tasks=20an=E2=80=A6=20(#28923)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …d dependency targets ## Current Behavior Dummy tasks are given an ID containing the parent task's target. Multiple parent tasks can create the same dummy task which overrides other dummy tasks. ## Expected Behavior Dummy tasks are given an ID containing the dependency and the parent tasks's name. This means different parent tasks will create different dummy tasks instead of overriding other ones. ## Related Issue(s) Fixes # --- packages/nx/src/tasks-runner/create-task-graph.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/nx/src/tasks-runner/create-task-graph.ts b/packages/nx/src/tasks-runner/create-task-graph.ts index 6ad8fb58801e6..bb97f6e06eff1 100644 --- a/packages/nx/src/tasks-runner/create-task-graph.ts +++ b/packages/nx/src/tasks-runner/create-task-graph.ts @@ -287,9 +287,13 @@ export class ProcessTasks { ); } } else { + // Create a dummy task for task.target.project... which simulates if depProject had dependencyConfig.target const dummyId = this.getId( depProject.name, - task.target.target + DUMMY_TASK_TARGET, + task.target.project + + '__' + + dependencyConfig.target + + DUMMY_TASK_TARGET, undefined ); this.dependencies[task.id].push(dummyId);