@nx/gradle 22.6.0-beta.6 → 22.6.0-beta.8
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/batch-runner/build/libs/gradle-batch-runner-all.jar +0 -0
- package/batch-runner/build/libs/gradle-batch-runner.jar +0 -0
- package/batch-runner/build/nx/gradle-batch-runner.json +1 -1
- package/package.json +3 -3
- package/project-graph/build/nx/gradle-project-graph.json +1 -1
- package/src/executors/gradle/gradle-batch.impl.d.ts.map +1 -1
- package/src/executors/gradle/gradle-batch.impl.js +10 -29
|
@@ -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,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;
|
|
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,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;;;;EAiE/C"}
|
|
@@ -8,7 +8,6 @@ const run_commands_impl_1 = require("nx/src/executors/run-commands/run-commands.
|
|
|
8
8
|
const exec_gradle_1 = require("../../utils/exec-gradle");
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
const child_process_1 = require("child_process");
|
|
11
|
-
const pseudo_terminal_1 = require("nx/src/tasks-runner/pseudo-terminal");
|
|
12
11
|
const get_exclude_task_1 = require("./get-exclude-task");
|
|
13
12
|
exports.batchRunnerPath = (0, path_1.join)(__dirname, '../../../batch-runner/build/libs/gradle-batch-runner-all.jar');
|
|
14
13
|
async function gradleBatch(taskGraph, inputs, overrides, context) {
|
|
@@ -112,38 +111,20 @@ function getGradlewTasksToRun(taskIds, taskGraph, inputs, nodes) {
|
|
|
112
111
|
}
|
|
113
112
|
async function runTasksInBatch(gradlewTasksToRun, excludeTasks, excludeTestTasks, args, root) {
|
|
114
113
|
const gradlewBatchStart = performance.mark(`gradlew-batch:start`);
|
|
115
|
-
const usePseudoTerminal = process.env.NX_NATIVE_COMMAND_RUNNER !== 'false' &&
|
|
116
|
-
pseudo_terminal_1.PseudoTerminal.isSupported();
|
|
117
114
|
const debugOptions = ' ' + (process.env.NX_GRADLE_BATCH_DEBUG ?? '');
|
|
118
115
|
const command = `java${debugOptions} -jar ${exports.batchRunnerPath} --tasks='${JSON.stringify(gradlewTasksToRun)}' --workspaceRoot=${root} --args='${args
|
|
119
116
|
.join(' ')
|
|
120
117
|
.replaceAll("'", '"')}' --excludeTasks='${Array.from(excludeTasks).join(',')}' --excludeTestTasks='${Array.from(excludeTestTasks).join(',')}' ${process.env.NX_VERBOSE_LOGGING === 'true' ? '' : '--quiet'}`;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
terminal.shutdown(0);
|
|
132
|
-
batchResults = results.terminalOutput;
|
|
133
|
-
batchResults = batchResults.replace(command, '');
|
|
134
|
-
const startIndex = batchResults.indexOf('{');
|
|
135
|
-
const endIndex = batchResults.lastIndexOf('}');
|
|
136
|
-
// only keep the json part
|
|
137
|
-
batchResults = batchResults.substring(startIndex, endIndex + 1);
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
batchResults = (0, child_process_1.execSync)(command, {
|
|
141
|
-
cwd: devkit_1.workspaceRoot,
|
|
142
|
-
windowsHide: true,
|
|
143
|
-
env: process.env,
|
|
144
|
-
maxBuffer: run_commands_impl_1.LARGE_BUFFER,
|
|
145
|
-
}).toString();
|
|
146
|
-
}
|
|
118
|
+
// Use 'inherit' for stderr so Gradle output (tee'd to System.err
|
|
119
|
+
// by TeeOutputStream) flows to the terminal in real-time.
|
|
120
|
+
// stdout is piped to capture the JSON batch results.
|
|
121
|
+
const batchResults = (0, child_process_1.execSync)(command, {
|
|
122
|
+
cwd: devkit_1.workspaceRoot,
|
|
123
|
+
windowsHide: true,
|
|
124
|
+
env: process.env,
|
|
125
|
+
stdio: ['pipe', 'pipe', 'inherit'],
|
|
126
|
+
maxBuffer: run_commands_impl_1.LARGE_BUFFER,
|
|
127
|
+
}).toString();
|
|
147
128
|
const gradlewBatchEnd = performance.mark(`gradlew-batch:end`);
|
|
148
129
|
performance.measure(`gradlew-batch`, gradlewBatchStart.name, gradlewBatchEnd.name);
|
|
149
130
|
const gradlewBatchResults = JSON.parse(batchResults);
|