@nx/gradle 19.2.0-rc.1 → 19.2.0
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": "19.2.0
|
3
|
+
"version": "19.2.0",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Nx Plugin for Gradle allows Gradle tasks to be run through Nx",
|
6
6
|
"repository": {
|
@@ -34,7 +34,7 @@
|
|
34
34
|
"migrations": "./migrations.json"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@nx/devkit": "19.2.0
|
37
|
+
"@nx/devkit": "19.2.0"
|
38
38
|
},
|
39
39
|
"publishConfig": {
|
40
40
|
"access": "public"
|
@@ -1,8 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
/// <reference types="node" />
|
3
|
-
import { ExecFileOptions } from 'child_process';
|
4
|
-
import { ExecFileSyncOptionsWithBufferEncoding } from 'node:child_process';
|
5
|
-
export declare function execGradle(args: string[], execOptions?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
3
|
+
import { ExecFileOptions } from 'node:child_process';
|
6
4
|
export declare function getGradleBinaryPath(): string;
|
7
5
|
export declare function getGradleExecFile(): string;
|
8
6
|
export declare function execGradleAsync(args: ReadonlyArray<string>, execOptions?: ExecFileOptions): Promise<Buffer>;
|
package/src/utils/exec-gradle.js
CHANGED
@@ -1,15 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.execGradleAsync = exports.getGradleExecFile = exports.getGradleBinaryPath =
|
3
|
+
exports.execGradleAsync = exports.getGradleExecFile = exports.getGradleBinaryPath = void 0;
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
5
|
const node_child_process_1 = require("node:child_process");
|
6
6
|
const node_fs_1 = require("node:fs");
|
7
7
|
const node_path_1 = require("node:path");
|
8
|
-
function execGradle(args, execOptions) {
|
9
|
-
const gradleBinaryPath = getGradleBinaryPath();
|
10
|
-
return (0, node_child_process_1.execFileSync)(gradleBinaryPath, args, execOptions);
|
11
|
-
}
|
12
|
-
exports.execGradle = execGradle;
|
13
8
|
function getGradleBinaryPath() {
|
14
9
|
const gradleFile = process.platform.startsWith('win')
|
15
10
|
? 'gradlew.bat'
|
@@ -25,10 +20,14 @@ function getGradleExecFile() {
|
|
25
20
|
return process.platform.startsWith('win') ? '.\\gradlew.bat' : './gradlew';
|
26
21
|
}
|
27
22
|
exports.getGradleExecFile = getGradleExecFile;
|
28
|
-
function execGradleAsync(args, execOptions) {
|
23
|
+
function execGradleAsync(args, execOptions = {}) {
|
29
24
|
const gradleBinaryPath = getGradleBinaryPath();
|
30
25
|
return new Promise((res, rej) => {
|
31
|
-
const cp = (0, node_child_process_1.execFile)(gradleBinaryPath, args,
|
26
|
+
const cp = (0, node_child_process_1.execFile)(gradleBinaryPath, args, {
|
27
|
+
...execOptions,
|
28
|
+
shell: true,
|
29
|
+
windowsHide: true,
|
30
|
+
});
|
32
31
|
let stdout = Buffer.from('');
|
33
32
|
cp.stdout?.on('data', (data) => {
|
34
33
|
stdout += data;
|
@@ -30,9 +30,9 @@ async function populateGradleReport(workspaceRoot) {
|
|
30
30
|
return;
|
31
31
|
}
|
32
32
|
const gradleProjectReportStart = performance.mark('gradleProjectReport:start');
|
33
|
-
const projectReportLines = (0, exec_gradle_1.
|
33
|
+
const projectReportLines = (await (0, exec_gradle_1.execGradleAsync)(['projectReport'], {
|
34
34
|
cwd: workspaceRoot,
|
35
|
-
})
|
35
|
+
}))
|
36
36
|
.toString()
|
37
37
|
.split(exports.newLineSeparator);
|
38
38
|
const gradleProjectReportEnd = performance.mark('gradleProjectReport:end');
|