Skip to content

Commit 3d0568d

Browse files
committed
fix(core): create different dummy tasks for different parent tasks an… (#28923)
…d dependency targets <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> 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 <!-- This is the behavior we should expect with the changes in this PR --> 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) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes # (cherry picked from commit 7f4fc50)
1 parent c1f068e commit 3d0568d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/nx/src/tasks-runner/create-task-graph.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,13 @@ export class ProcessTasks {
287287
);
288288
}
289289
} else {
290+
// Create a dummy task for task.target.project... which simulates if depProject had dependencyConfig.target
290291
const dummyId = this.getId(
291292
depProject.name,
292-
task.target.target + DUMMY_TASK_TARGET,
293+
task.target.project +
294+
'__' +
295+
dependencyConfig.target +
296+
DUMMY_TASK_TARGET,
293297
undefined
294298
);
295299
this.dependencies[task.id].push(dummyId);

0 commit comments

Comments
 (0)