fix(core): forward args to target dependencies with the same executor as the target that is being run (#8104)
This commit is contained in:
parent
e2626adb68
commit
0ce96a47f1
@ -749,7 +749,7 @@ describe('createTasksForProjectToRun', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should forward overrides to tasks with the same target name', () => {
|
it('should forward overrides to tasks with the same target executor', () => {
|
||||||
projectGraph.nodes.app1.data.targets.build.dependsOn = [
|
projectGraph.nodes.app1.data.targets.build.dependsOn = [
|
||||||
{
|
{
|
||||||
target: 'prebuild',
|
target: 'prebuild',
|
||||||
@ -760,11 +760,31 @@ describe('createTasksForProjectToRun', () => {
|
|||||||
projects: 'dependencies',
|
projects: 'dependencies',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
projectGraph.dependencies.app1.push({
|
projectGraph.nodes.app1.data.targets.build.executor = 'executor1';
|
||||||
|
projectGraph.nodes.lib1.data.targets.build.executor = 'executor1';
|
||||||
|
projectGraph.nodes.app1.data.targets.prebuild.executor = 'executor2';
|
||||||
|
projectGraph.nodes.lib2 = {
|
||||||
|
data: {
|
||||||
|
root: 'lib2-root',
|
||||||
|
files: [],
|
||||||
|
targets: { build: { executor: 'executor2' } },
|
||||||
|
},
|
||||||
|
name: 'lib2',
|
||||||
|
type: 'lib',
|
||||||
|
};
|
||||||
|
projectGraph.dependencies.lib2 = [];
|
||||||
|
projectGraph.dependencies.app1.push(
|
||||||
|
{
|
||||||
type: DependencyType.static,
|
type: DependencyType.static,
|
||||||
source: 'app1',
|
source: 'app1',
|
||||||
target: 'lib1',
|
target: 'lib1',
|
||||||
});
|
},
|
||||||
|
{
|
||||||
|
type: DependencyType.static,
|
||||||
|
source: 'app1',
|
||||||
|
target: 'lib2',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const tasks = createTasksForProjectToRun(
|
const tasks = createTasksForProjectToRun(
|
||||||
[projectGraph.nodes.app1],
|
[projectGraph.nodes.app1],
|
||||||
@ -798,6 +818,16 @@ describe('createTasksForProjectToRun', () => {
|
|||||||
target: 'build',
|
target: 'build',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'lib2:build',
|
||||||
|
overrides: {},
|
||||||
|
projectRoot: 'lib2-root',
|
||||||
|
target: {
|
||||||
|
configuration: undefined,
|
||||||
|
project: 'lib2',
|
||||||
|
target: 'build',
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'app1:build',
|
id: 'app1:build',
|
||||||
overrides: { myFlag: 'flag value' },
|
overrides: { myFlag: 'flag value' },
|
||||||
|
|||||||
@ -212,7 +212,7 @@ export function createTasksForProjectToRun(
|
|||||||
},
|
},
|
||||||
defaultDependencyConfigs,
|
defaultDependencyConfigs,
|
||||||
projectGraph,
|
projectGraph,
|
||||||
params.target,
|
project.data.targets?.[params.target]?.executor,
|
||||||
tasksMap,
|
tasksMap,
|
||||||
[],
|
[],
|
||||||
seenSet
|
seenSet
|
||||||
@ -231,7 +231,7 @@ function addTasksForProjectTarget(
|
|||||||
}: TaskParams,
|
}: TaskParams,
|
||||||
defaultDependencyConfigs: Record<string, TargetDependencyConfig[]> = {},
|
defaultDependencyConfigs: Record<string, TargetDependencyConfig[]> = {},
|
||||||
projectGraph: ProjectGraph,
|
projectGraph: ProjectGraph,
|
||||||
originalTargetName: string,
|
originalTargetExecutor: string,
|
||||||
tasksMap: Map<string, Task>,
|
tasksMap: Map<string, Task>,
|
||||||
path: string[],
|
path: string[],
|
||||||
seenSet: Set<string>
|
seenSet: Set<string>
|
||||||
@ -240,7 +240,10 @@ function addTasksForProjectTarget(
|
|||||||
project,
|
project,
|
||||||
target,
|
target,
|
||||||
configuration,
|
configuration,
|
||||||
overrides: target === originalTargetName ? overrides : {},
|
overrides:
|
||||||
|
project.data.targets?.[target]?.executor === originalTargetExecutor
|
||||||
|
? overrides
|
||||||
|
: {},
|
||||||
errorIfCannotFindConfiguration,
|
errorIfCannotFindConfiguration,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -262,7 +265,7 @@ function addTasksForProjectTarget(
|
|||||||
dependencyConfig,
|
dependencyConfig,
|
||||||
defaultDependencyConfigs,
|
defaultDependencyConfigs,
|
||||||
projectGraph,
|
projectGraph,
|
||||||
originalTargetName,
|
originalTargetExecutor,
|
||||||
tasksMap,
|
tasksMap,
|
||||||
path,
|
path,
|
||||||
seenSet
|
seenSet
|
||||||
@ -326,7 +329,7 @@ function addTasksForProjectDependencyConfig(
|
|||||||
dependencyConfig: TargetDependencyConfig,
|
dependencyConfig: TargetDependencyConfig,
|
||||||
defaultDependencyConfigs: Record<string, TargetDependencyConfig[]>,
|
defaultDependencyConfigs: Record<string, TargetDependencyConfig[]>,
|
||||||
projectGraph: ProjectGraph,
|
projectGraph: ProjectGraph,
|
||||||
originalTargetName: string,
|
originalTargetExecutor: string,
|
||||||
tasksMap: Map<string, Task>,
|
tasksMap: Map<string, Task>,
|
||||||
path: string[],
|
path: string[],
|
||||||
seenSet: Set<string>
|
seenSet: Set<string>
|
||||||
@ -368,7 +371,7 @@ function addTasksForProjectDependencyConfig(
|
|||||||
},
|
},
|
||||||
defaultDependencyConfigs,
|
defaultDependencyConfigs,
|
||||||
projectGraph,
|
projectGraph,
|
||||||
originalTargetName,
|
originalTargetExecutor,
|
||||||
tasksMap,
|
tasksMap,
|
||||||
[...path, targetIdentifier],
|
[...path, targetIdentifier],
|
||||||
seenSet
|
seenSet
|
||||||
@ -384,7 +387,7 @@ function addTasksForProjectDependencyConfig(
|
|||||||
dependencyConfig,
|
dependencyConfig,
|
||||||
defaultDependencyConfigs,
|
defaultDependencyConfigs,
|
||||||
projectGraph,
|
projectGraph,
|
||||||
originalTargetName,
|
originalTargetExecutor,
|
||||||
tasksMap,
|
tasksMap,
|
||||||
path,
|
path,
|
||||||
seenSet
|
seenSet
|
||||||
@ -403,7 +406,7 @@ function addTasksForProjectDependencyConfig(
|
|||||||
},
|
},
|
||||||
defaultDependencyConfigs,
|
defaultDependencyConfigs,
|
||||||
projectGraph,
|
projectGraph,
|
||||||
originalTargetName,
|
originalTargetExecutor,
|
||||||
tasksMap,
|
tasksMap,
|
||||||
[...path, targetIdentifier],
|
[...path, targetIdentifier],
|
||||||
seenSet
|
seenSet
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user