@nx/gradle 23.0.0-beta.0 → 23.0.0-pr.35413.460eeef

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/gradle",
3
- "version": "23.0.0-beta.0",
3
+ "version": "23.0.0-pr.35413.460eeef",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Gradle allows Gradle tasks to be run through Nx",
6
6
  "repository": {
@@ -40,13 +40,13 @@
40
40
  "migrations": "./migrations.json"
41
41
  },
42
42
  "dependencies": {
43
- "@nx/devkit": "23.0.0-beta.0",
43
+ "@nx/devkit": "23.0.0-pr.35413.460eeef",
44
44
  "toml-eslint-parser": "^0.10.0",
45
45
  "tree-kill": "^1.2.2",
46
46
  "tslib": "^2.3.0"
47
47
  },
48
48
  "devDependencies": {
49
- "nx": "23.0.0-beta.0"
49
+ "nx": "23.0.0-pr.35413.460eeef"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
@@ -1,10 +1,14 @@
1
- import { ProjectGraphProjectNode, Target } from '@nx/devkit';
1
+ import { ProjectGraphProjectNode, Target, TaskGraph } from '@nx/devkit';
2
2
  /**
3
- * Returns Gradle CLI arguments to exclude dependent tasks
4
- * that are not part of the current execution set.
3
+ * Project-graph-based exclude resolver for the single-task executor.
5
4
  *
6
- * For example, if a project defines `dependsOn: ['lint']` for the `test` target,
7
- * and only `test` is running, this will return: ['lint']
5
+ * Walks the full transitive dependsOn graph for each task so that
6
+ * indirect dependencies (e.g. the deps of a direct dep's `jar`)
7
+ * are also excluded, matching Gradle's own transitive task graph.
8
+ *
9
+ * For batch mode, prefer `getExcludeTasksFromTaskGraph` — it uses the
10
+ * TaskGraph Nx has already computed, which reflects exactly what will
11
+ * run and picks up cross-project implicit dependencies.
8
12
  *
9
13
  * @param tasks - Set of Target to process
10
14
  * @param nodes - Project graph nodes
@@ -14,5 +18,25 @@ import { ProjectGraphProjectNode, Target } from '@nx/devkit';
14
18
  */
15
19
  export declare function getExcludeTasks(tasks: Set<Target>, nodes: Record<string, ProjectGraphProjectNode>, runningTasks?: Set<Target>, includeDependsOnTasks?: Set<string>): Set<string>;
16
20
  export declare function getGradleTaskName(pt: Target, nodes: Record<string, ProjectGraphProjectNode>): string | null;
17
- export declare function getAllDependsOn(nodes: Record<string, ProjectGraphProjectNode>, projectName: string, targetName: string): Set<Target>;
21
+ /**
22
+ * Task-graph-based exclude resolver for batch mode.
23
+ *
24
+ * Walks `taskGraph.dependencies` transitively from each starting task id.
25
+ * Any reachable dependency task that is NOT in `runningTaskIds` has its
26
+ * Gradle `taskName` (resolved from project graph nodes) added to the
27
+ * excludes, unless it appears in `includeDependsOnTasks`.
28
+ *
29
+ * @param taskIdsToExcludeDepsOf - Task IDs whose dependsOn chain should be excluded
30
+ * @param runningTaskIds - Task IDs that WILL run and therefore must not be excluded
31
+ * @param taskGraph - The task graph for the current batch
32
+ * @param nodes - Project graph nodes, used only to look up each task's `taskName`
33
+ * @param includeDependsOnTasks - Gradle task names to never exclude (provider-based deps)
34
+ */
35
+ export declare function getExcludeTasksFromTaskGraph(taskIdsToExcludeDepsOf: Iterable<string>, runningTaskIds: Set<string>, taskGraph: TaskGraph, nodes: Record<string, ProjectGraphProjectNode>, includeDependsOnTasks?: Set<string>): Set<string>;
36
+ /**
37
+ * Returns the transitive set of dependency task IDs reachable via
38
+ * `taskGraph.dependencies` from the given starting IDs. The starting
39
+ * IDs themselves are NOT included in the result. Cycle-safe.
40
+ */
41
+ export declare function getAllDependsOnFromTaskGraph(startTaskIds: Iterable<string>, taskGraph: TaskGraph): Set<string>;
18
42
  //# sourceMappingURL=get-exclude-task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-exclude-task.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/executors/gradle/get-exclude-task.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,MAAM,EAEP,MAAM,YAAY,CAAC;AA+BpB;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAClB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,EAC9C,YAAY,GAAE,GAAG,CAAC,MAAM,CAAa,EACrC,qBAAqB,GAAE,GAAG,CAAC,MAAM,CAAa,GAC7C,GAAG,CAAC,MAAM,CAAC,CAsBb;AAED,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAC7C,MAAM,GAAG,IAAI,CAEf;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,EAC9C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,GAAG,CAAC,MAAM,CAAC,CAgCb"}
1
+ {"version":3,"file":"get-exclude-task.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/executors/gradle/get-exclude-task.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,MAAM,EACN,SAAS,EAEV,MAAM,YAAY,CAAC;AA+BpB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAClB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,EAC9C,YAAY,GAAE,GAAG,CAAC,MAAM,CAAa,EACrC,qBAAqB,GAAE,GAAG,CAAC,MAAM,CAAa,GAC7C,GAAG,CAAC,MAAM,CAAC,CAwBb;AAED,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAC7C,MAAM,GAAG,IAAI,CAEf;AAwCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAC1C,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,EACxC,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,EAC3B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,EAC9C,qBAAqB,GAAE,GAAG,CAAC,MAAM,CAAa,GAC7C,GAAG,CAAC,MAAM,CAAC,CAsBb;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,EAC9B,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,MAAM,CAAC,CA4Bb"}
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExcludeTasks = getExcludeTasks;
4
4
  exports.getGradleTaskName = getGradleTaskName;
5
- exports.getAllDependsOn = getAllDependsOn;
5
+ exports.getExcludeTasksFromTaskGraph = getExcludeTasksFromTaskGraph;
6
+ exports.getAllDependsOnFromTaskGraph = getAllDependsOnFromTaskGraph;
6
7
  const devkit_1 = require("@nx/devkit");
7
8
  /**
8
9
  * Resolves a dependsOn entry to a Target.
@@ -30,11 +31,15 @@ function resolveDepToTarget(dep, owningProject) {
30
31
  return { project: owningProject, target };
31
32
  }
32
33
  /**
33
- * Returns Gradle CLI arguments to exclude dependent tasks
34
- * that are not part of the current execution set.
34
+ * Project-graph-based exclude resolver for the single-task executor.
35
35
  *
36
- * For example, if a project defines `dependsOn: ['lint']` for the `test` target,
37
- * and only `test` is running, this will return: ['lint']
36
+ * Walks the full transitive dependsOn graph for each task so that
37
+ * indirect dependencies (e.g. the deps of a direct dep's `jar`)
38
+ * are also excluded, matching Gradle's own transitive task graph.
39
+ *
40
+ * For batch mode, prefer `getExcludeTasksFromTaskGraph` — it uses the
41
+ * TaskGraph Nx has already computed, which reflects exactly what will
42
+ * run and picks up cross-project implicit dependencies.
38
43
  *
39
44
  * @param tasks - Set of Target to process
40
45
  * @param nodes - Project graph nodes
@@ -46,14 +51,14 @@ function getExcludeTasks(tasks, nodes, runningTasks = new Set(), includeDependsO
46
51
  const excludes = new Set();
47
52
  const runningKeys = new Set(Array.from(runningTasks).map(devkit_1.targetToTargetString));
48
53
  for (const task of tasks) {
49
- const taskDeps = nodes[task.project]?.data?.targets?.[task.target]?.dependsOn ?? [];
50
- for (const dep of taskDeps) {
51
- const depPt = resolveDepToTarget(dep, task.project);
52
- if (depPt && !runningKeys.has((0, devkit_1.targetToTargetString)(depPt))) {
53
- const gradleTaskName = getGradleTaskName(depPt, nodes);
54
- if (gradleTaskName && !includeDependsOnTasks.has(gradleTaskName)) {
55
- excludes.add(gradleTaskName);
56
- }
54
+ const transitiveDeps = getAllDependsOnFromProjectGraph(nodes, task.project, task.target);
55
+ for (const depPt of transitiveDeps) {
56
+ if (runningKeys.has((0, devkit_1.targetToTargetString)(depPt))) {
57
+ continue;
58
+ }
59
+ const gradleTaskName = getGradleTaskName(depPt, nodes);
60
+ if (gradleTaskName && !includeDependsOnTasks.has(gradleTaskName)) {
61
+ excludes.add(gradleTaskName);
57
62
  }
58
63
  }
59
64
  }
@@ -62,8 +67,8 @@ function getExcludeTasks(tasks, nodes, runningTasks = new Set(), includeDependsO
62
67
  function getGradleTaskName(pt, nodes) {
63
68
  return nodes[pt.project]?.data?.targets?.[pt.target]?.options?.taskName;
64
69
  }
65
- function getAllDependsOn(nodes, projectName, targetName) {
66
- const allDependsOn = new Set();
70
+ function getAllDependsOnFromProjectGraph(nodes, projectName, targetName) {
71
+ const seen = new Set();
67
72
  const result = new Set();
68
73
  const startKey = (0, devkit_1.targetToTargetString)({
69
74
  project: projectName,
@@ -73,18 +78,80 @@ function getAllDependsOn(nodes, projectName, targetName) {
73
78
  while (stack.length > 0) {
74
79
  const current = stack.pop();
75
80
  const key = (0, devkit_1.targetToTargetString)(current);
76
- if (!allDependsOn.has(key)) {
77
- allDependsOn.add(key);
78
- if (key !== startKey) {
79
- result.add(current);
81
+ if (seen.has(key)) {
82
+ continue;
83
+ }
84
+ seen.add(key);
85
+ if (key !== startKey) {
86
+ result.add(current);
87
+ }
88
+ const directDependencies = nodes[current.project]?.data?.targets?.[current.target]?.dependsOn ?? [];
89
+ for (const dep of directDependencies) {
90
+ const depPt = resolveDepToTarget(dep, current.project);
91
+ if (depPt && !seen.has((0, devkit_1.targetToTargetString)(depPt))) {
92
+ stack.push(depPt);
80
93
  }
81
- const directDependencies = nodes[current.project]?.data?.targets?.[current.target]?.dependsOn ??
82
- [];
83
- for (const dep of directDependencies) {
84
- const depPt = resolveDepToTarget(dep, current.project);
85
- if (depPt && !allDependsOn.has((0, devkit_1.targetToTargetString)(depPt))) {
86
- stack.push(depPt);
87
- }
94
+ }
95
+ }
96
+ return result;
97
+ }
98
+ /**
99
+ * Task-graph-based exclude resolver for batch mode.
100
+ *
101
+ * Walks `taskGraph.dependencies` transitively from each starting task id.
102
+ * Any reachable dependency task that is NOT in `runningTaskIds` has its
103
+ * Gradle `taskName` (resolved from project graph nodes) added to the
104
+ * excludes, unless it appears in `includeDependsOnTasks`.
105
+ *
106
+ * @param taskIdsToExcludeDepsOf - Task IDs whose dependsOn chain should be excluded
107
+ * @param runningTaskIds - Task IDs that WILL run and therefore must not be excluded
108
+ * @param taskGraph - The task graph for the current batch
109
+ * @param nodes - Project graph nodes, used only to look up each task's `taskName`
110
+ * @param includeDependsOnTasks - Gradle task names to never exclude (provider-based deps)
111
+ */
112
+ function getExcludeTasksFromTaskGraph(taskIdsToExcludeDepsOf, runningTaskIds, taskGraph, nodes, includeDependsOnTasks = new Set()) {
113
+ const excludes = new Set();
114
+ const transitiveDepIds = getAllDependsOnFromTaskGraph(taskIdsToExcludeDepsOf, taskGraph);
115
+ for (const depTaskId of transitiveDepIds) {
116
+ if (runningTaskIds.has(depTaskId)) {
117
+ continue;
118
+ }
119
+ const task = taskGraph.tasks[depTaskId];
120
+ if (!task) {
121
+ continue;
122
+ }
123
+ const gradleTaskName = getGradleTaskName(task.target, nodes);
124
+ if (gradleTaskName && !includeDependsOnTasks.has(gradleTaskName)) {
125
+ excludes.add(gradleTaskName);
126
+ }
127
+ }
128
+ return excludes;
129
+ }
130
+ /**
131
+ * Returns the transitive set of dependency task IDs reachable via
132
+ * `taskGraph.dependencies` from the given starting IDs. The starting
133
+ * IDs themselves are NOT included in the result. Cycle-safe.
134
+ */
135
+ function getAllDependsOnFromTaskGraph(startTaskIds, taskGraph) {
136
+ const result = new Set();
137
+ const seen = new Set();
138
+ const stack = [];
139
+ for (const id of startTaskIds) {
140
+ seen.add(id);
141
+ for (const dep of taskGraph.dependencies[id] ?? []) {
142
+ stack.push(dep);
143
+ }
144
+ }
145
+ while (stack.length > 0) {
146
+ const current = stack.pop();
147
+ if (seen.has(current)) {
148
+ continue;
149
+ }
150
+ seen.add(current);
151
+ result.add(current);
152
+ for (const dep of taskGraph.dependencies[current] ?? []) {
153
+ if (!seen.has(dep)) {
154
+ stack.push(dep);
88
155
  }
89
156
  }
90
157
  }
@@ -5,9 +5,15 @@ import { GradleExecutorSchema } from './schema';
5
5
  export declare const batchRunnerPath: string;
6
6
  export default function gradleBatch(taskGraph: TaskGraph, inputs: Record<string, GradleExecutorSchema>, overrides: RunCommandsOptions, context: ExecutorContext): Promise<BatchResults>;
7
7
  /**
8
- * Get the gradlew task ids to run
8
+ * Get the gradlew task ids to run.
9
+ *
10
+ * `taskGraph` is the batch's task graph (only tasks running in this batch
11
+ * invocation). `fullTaskGraph` is the full task graph for the whole `nx`
12
+ * command (defaults to `taskGraph`); transitive dependency walks use it so
13
+ * that deps filtered out of the batch — cached tasks, tasks scheduled in
14
+ * other batches — are still resolved when computing excludes.
9
15
  */
10
- export declare function getGradlewTasksToRun(taskIds: string[], taskGraph: TaskGraph, inputs: Record<string, GradleExecutorSchema>, nodes: Record<string, ProjectGraphProjectNode>): {
16
+ export declare function getGradlewTasksToRun(taskIds: string[], taskGraph: TaskGraph, inputs: Record<string, GradleExecutorSchema>, nodes: Record<string, ProjectGraphProjectNode>, fullTaskGraph?: TaskGraph): {
11
17
  gradlewTasksToRun: Record<string, GradleExecutorSchema>;
12
18
  excludeTasks: Set<string>;
13
19
  excludeTestTasks: Set<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"gradle-batch.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/executors/gradle/gradle-batch.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,uBAAuB,EAEvB,SAAS,EAEV,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,kBAAkB,EACnB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAchD,eAAO,MAAM,eAAe,QAG3B,CAAC;AAEF,wBAA8B,WAAW,CACvC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAC5C,SAAS,EAAE,kBAAkB,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,YAAY,CAAC,CAkEvB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC;;;;EAuE/C"}
1
+ {"version":3,"file":"gradle-batch.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/executors/gradle/gradle-batch.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,uBAAuB,EACvB,SAAS,EAEV,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,kBAAkB,EACnB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAchD,eAAO,MAAM,eAAe,QAG3B,CAAC;AAEF,wBAA8B,WAAW,CACvC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAC5C,SAAS,EAAE,kBAAkB,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,YAAY,CAAC,CAmEvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,EAC9C,aAAa,GAAE,SAAqB;;;;EAuErC"}
@@ -28,7 +28,7 @@ async function gradleBatch(taskGraph, inputs, overrides, context) {
28
28
  args.push(...overrides.__overrides_unparsed__);
29
29
  }
30
30
  const taskIds = Object.keys(taskGraph.tasks);
31
- const { gradlewTasksToRun, excludeTasks, excludeTestTasks } = getGradlewTasksToRun(taskIds, taskGraph, inputs, context.projectGraph.nodes);
31
+ const { gradlewTasksToRun, excludeTasks, excludeTestTasks } = getGradlewTasksToRun(taskIds, taskGraph, inputs, context.projectGraph.nodes, context.taskGraph ?? taskGraph);
32
32
  const batchResults = await runTasksInBatch(gradlewTasksToRun, excludeTasks, excludeTestTasks, args, root);
33
33
  taskIds.forEach((taskId) => {
34
34
  if (!batchResults[taskId]) {
@@ -52,21 +52,22 @@ async function gradleBatch(taskGraph, inputs, overrides, context) {
52
52
  }
53
53
  }
54
54
  /**
55
- * Get the gradlew task ids to run
55
+ * Get the gradlew task ids to run.
56
+ *
57
+ * `taskGraph` is the batch's task graph (only tasks running in this batch
58
+ * invocation). `fullTaskGraph` is the full task graph for the whole `nx`
59
+ * command (defaults to `taskGraph`); transitive dependency walks use it so
60
+ * that deps filtered out of the batch — cached tasks, tasks scheduled in
61
+ * other batches — are still resolved when computing excludes.
56
62
  */
57
- function getGradlewTasksToRun(taskIds, taskGraph, inputs, nodes) {
58
- const tasksWithExclude = new Set();
59
- const testTasksWithExclude = new Set();
60
- const tasksWithoutExclude = new Set();
63
+ function getGradlewTasksToRun(taskIds, taskGraph, inputs, nodes, fullTaskGraph = taskGraph) {
64
+ const tasksWithExcludeIds = new Set();
65
+ const testTasksWithExcludeIds = new Set();
66
+ const tasksWithoutExcludeIds = new Set();
61
67
  const gradlewTasksToRun = {};
62
68
  const includeDependsOnTasks = new Set();
63
69
  for (const taskId of taskIds) {
64
- const task = taskGraph.tasks[taskId];
65
- const input = inputs[task.id];
66
- const taskTarget = {
67
- project: task.target.project,
68
- target: task.target.target,
69
- };
70
+ const input = inputs[taskId];
70
71
  gradlewTasksToRun[taskId] = input;
71
72
  if (input.includeDependsOnTasks) {
72
73
  for (const t of input.includeDependsOnTasks) {
@@ -75,33 +76,33 @@ function getGradlewTasksToRun(taskIds, taskGraph, inputs, nodes) {
75
76
  }
76
77
  if (input.excludeDependsOn) {
77
78
  if (input.testClassName) {
78
- testTasksWithExclude.add(taskTarget);
79
+ testTasksWithExcludeIds.add(taskId);
79
80
  }
80
81
  else {
81
- tasksWithExclude.add(taskTarget);
82
+ tasksWithExcludeIds.add(taskId);
82
83
  }
83
84
  }
84
85
  else {
85
- tasksWithoutExclude.add(taskTarget);
86
+ tasksWithoutExcludeIds.add(taskId);
86
87
  }
87
88
  }
88
- const allRunning = new Set(taskIds.map((id) => ({
89
- project: taskGraph.tasks[id].target.project,
90
- target: taskGraph.tasks[id].target.target,
91
- })));
92
- for (const task of tasksWithoutExclude) {
93
- const dependencies = (0, get_exclude_task_1.getAllDependsOn)(nodes, task.project, task.target);
94
- dependencies.forEach((dep) => allRunning.add(dep));
95
- }
96
- const excludeTasks = (0, get_exclude_task_1.getExcludeTasks)(tasksWithExclude, nodes, allRunning, includeDependsOnTasks);
97
- const allTestsDependsOn = new Set();
98
- for (const task of testTasksWithExclude) {
99
- const taskDependsOn = (0, get_exclude_task_1.getAllDependsOn)(nodes, task.project, task.target);
100
- taskDependsOn.forEach((dep) => allTestsDependsOn.add(dep));
89
+ const runningTaskIds = new Set(taskIds);
90
+ const batchTaskIds = new Set(taskIds);
91
+ const nonExcludeDeps = (0, get_exclude_task_1.getAllDependsOnFromTaskGraph)(tasksWithoutExcludeIds, fullTaskGraph);
92
+ for (const depId of nonExcludeDeps) {
93
+ if (batchTaskIds.has(depId)) {
94
+ runningTaskIds.add(depId);
95
+ }
101
96
  }
97
+ const excludeTasks = (0, get_exclude_task_1.getExcludeTasksFromTaskGraph)(tasksWithExcludeIds, runningTaskIds, fullTaskGraph, nodes, includeDependsOnTasks);
102
98
  const excludeTestTasks = new Set();
103
- for (const task of allTestsDependsOn) {
104
- const gradleTaskName = (0, get_exclude_task_1.getGradleTaskName)(task, nodes);
99
+ const testDepIds = (0, get_exclude_task_1.getAllDependsOnFromTaskGraph)(testTasksWithExcludeIds, fullTaskGraph);
100
+ for (const depTaskId of testDepIds) {
101
+ const task = fullTaskGraph.tasks[depTaskId];
102
+ if (!task) {
103
+ continue;
104
+ }
105
+ const gradleTaskName = (0, get_exclude_task_1.getGradleTaskName)(task.target, nodes);
105
106
  if (gradleTaskName) {
106
107
  excludeTestTasks.add(gradleTaskName);
107
108
  }