@nx/gradle 22.7.0-beta.10 → 22.7.0-beta.12
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/migrations.json +6 -0
- package/package.json +3 -3
- package/src/executors/gradle/gradle-batch.impl.js +31 -12
- package/src/migrations/22-7-0/change-plugin-version-0-1-19.d.ts +3 -0
- package/src/migrations/22-7-0/change-plugin-version-0-1-19.d.ts.map +1 -0
- package/src/migrations/22-7-0/change-plugin-version-0-1-19.js +23 -0
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
|
Binary file
|
|
Binary file
|
package/migrations.json
CHANGED
|
@@ -119,6 +119,12 @@
|
|
|
119
119
|
"cli": "nx",
|
|
120
120
|
"description": "Change dev.nx.gradle.project-graph to version 0.1.18 in build file",
|
|
121
121
|
"factory": "./src/migrations/22-7-0/change-plugin-version-0-1-18"
|
|
122
|
+
},
|
|
123
|
+
"change-plugin-version-0-1-19": {
|
|
124
|
+
"version": "22.7.0-beta.11",
|
|
125
|
+
"cli": "nx",
|
|
126
|
+
"description": "Change dev.nx.gradle.project-graph to version 0.1.19 in build file",
|
|
127
|
+
"factory": "./src/migrations/22-7-0/change-plugin-version-0-1-19"
|
|
122
128
|
}
|
|
123
129
|
},
|
|
124
130
|
"packageJsonUpdates": {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/gradle",
|
|
3
|
-
"version": "22.7.0-beta.
|
|
3
|
+
"version": "22.7.0-beta.12",
|
|
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": "22.7.0-beta.
|
|
43
|
+
"@nx/devkit": "22.7.0-beta.12",
|
|
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": "22.7.0-beta.
|
|
49
|
+
"nx": "22.7.0-beta.12"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
@@ -4,7 +4,6 @@ exports.batchRunnerPath = void 0;
|
|
|
4
4
|
exports.default = gradleBatch;
|
|
5
5
|
exports.getGradlewTasksToRun = getGradlewTasksToRun;
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const run_commands_impl_1 = require("nx/src/executors/run-commands/run-commands.impl");
|
|
8
7
|
const exec_gradle_1 = require("../../utils/exec-gradle");
|
|
9
8
|
const path_1 = require("path");
|
|
10
9
|
const child_process_1 = require("child_process");
|
|
@@ -115,20 +114,40 @@ function getGradlewTasksToRun(taskIds, taskGraph, inputs, nodes) {
|
|
|
115
114
|
}
|
|
116
115
|
async function runTasksInBatch(gradlewTasksToRun, excludeTasks, excludeTestTasks, args, root) {
|
|
117
116
|
const gradlewBatchStart = performance.mark(`gradlew-batch:start`);
|
|
118
|
-
const debugOptions =
|
|
119
|
-
const
|
|
120
|
-
.
|
|
121
|
-
|
|
117
|
+
const debugOptions = (process.env.NX_GRADLE_BATCH_DEBUG ?? '').trim();
|
|
118
|
+
const spawnArgs = [
|
|
119
|
+
...(debugOptions ? debugOptions.split(/\s+/) : []),
|
|
120
|
+
'-jar',
|
|
121
|
+
exports.batchRunnerPath,
|
|
122
|
+
`--tasks=${JSON.stringify(gradlewTasksToRun)}`,
|
|
123
|
+
`--workspaceRoot=${root}`,
|
|
124
|
+
`--args=${args.join(' ').replaceAll("'", '"')}`,
|
|
125
|
+
`--excludeTasks=${Array.from(excludeTasks).join(',')}`,
|
|
126
|
+
`--excludeTestTasks=${Array.from(excludeTestTasks).join(',')}`,
|
|
127
|
+
...(process.env.NX_VERBOSE_LOGGING === 'true' ? [] : ['--quiet']),
|
|
128
|
+
];
|
|
122
129
|
// Use 'inherit' for stderr so Gradle output (tee'd to System.err
|
|
123
130
|
// by TeeOutputStream) flows to the terminal in real-time.
|
|
124
131
|
// stdout is piped to capture the JSON batch results.
|
|
125
|
-
const batchResults = (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
const batchResults = await new Promise((resolve, reject) => {
|
|
133
|
+
const cp = (0, child_process_1.spawn)('java', spawnArgs, {
|
|
134
|
+
cwd: devkit_1.workspaceRoot,
|
|
135
|
+
windowsHide: true,
|
|
136
|
+
env: process.env,
|
|
137
|
+
stdio: ['pipe', 'pipe', 'inherit'],
|
|
138
|
+
});
|
|
139
|
+
const chunks = [];
|
|
140
|
+
cp.stdout.on('data', (chunk) => chunks.push(chunk));
|
|
141
|
+
cp.on('error', reject);
|
|
142
|
+
cp.on('close', (code) => {
|
|
143
|
+
if (code !== 0) {
|
|
144
|
+
reject(new Error(`Gradle batch runner exited with code ${code}`));
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
resolve(Buffer.concat(chunks).toString());
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
132
151
|
const gradlewBatchEnd = performance.mark(`gradlew-batch:end`);
|
|
133
152
|
performance.measure(`gradlew-batch`, gradlewBatchStart.name, gradlewBatchEnd.name);
|
|
134
153
|
const gradlewBatchResults = JSON.parse(batchResults);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-plugin-version-0-1-19.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/migrations/22-7-0/change-plugin-version-0-1-19.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAO9C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,iBAgB9C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const has_gradle_plugin_1 = require("../../utils/has-gradle-plugin");
|
|
6
|
+
const gradle_project_graph_plugin_utils_1 = require("../../generators/init/gradle-project-graph-plugin-utils");
|
|
7
|
+
const version_catalog_ast_utils_1 = require("../../utils/version-catalog-ast-utils");
|
|
8
|
+
/* Change the plugin version to 0.1.19
|
|
9
|
+
*/
|
|
10
|
+
async function update(tree) {
|
|
11
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
12
|
+
if (!nxJson) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (!(0, has_gradle_plugin_1.hasGradlePlugin)(tree)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const gradlePluginVersionToUpdate = '0.1.19';
|
|
19
|
+
// Update version in version catalogs using AST-based approach to preserve formatting
|
|
20
|
+
await (0, version_catalog_ast_utils_1.updateNxPluginVersionInCatalogsAst)(tree, gradlePluginVersionToUpdate);
|
|
21
|
+
// Then update in build.gradle(.kts) files
|
|
22
|
+
await (0, gradle_project_graph_plugin_utils_1.addNxProjectGraphPlugin)(tree, gradlePluginVersionToUpdate);
|
|
23
|
+
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
2
|
export declare const gradleProjectGraphPluginName = "dev.nx.gradle.project-graph";
|
|
3
|
-
export declare const gradleProjectGraphVersion = "0.1.
|
|
3
|
+
export declare const gradleProjectGraphVersion = "0.1.19";
|
|
4
4
|
//# sourceMappingURL=versions.d.ts.map
|
package/src/utils/versions.js
CHANGED
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.gradleProjectGraphVersion = exports.gradleProjectGraphPluginName = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
5
|
exports.gradleProjectGraphPluginName = 'dev.nx.gradle.project-graph';
|
|
6
|
-
exports.gradleProjectGraphVersion = '0.1.
|
|
6
|
+
exports.gradleProjectGraphVersion = '0.1.19';
|