@nx/gradle 19.0.0-canary.20240430-458f2cc → 19.0.0-canary.20240502-5ded713
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.0.0-canary.
|
3
|
+
"version": "19.0.0-canary.20240502-5ded713",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Nx Plugin for Gradle allows Gradle tasks to be run through Nx",
|
6
6
|
"repository": {
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"migrations": "./migrations.json"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@nx/devkit": "19.0.0-canary.
|
36
|
+
"@nx/devkit": "19.0.0-canary.20240502-5ded713"
|
37
37
|
},
|
38
38
|
"publishConfig": {
|
39
39
|
"access": "public"
|
package/src/plugin/nodes.js
CHANGED
@@ -82,9 +82,8 @@ function createGradleTargets(tasks, projectRoot, options, context, outputDirs) {
|
|
82
82
|
for (const task of tasks) {
|
83
83
|
const targetName = options?.[`${task.name}TargetName`] ?? task.name;
|
84
84
|
const outputs = outputDirs.get(task.name);
|
85
|
-
const path = (0, node_path_1.relative)((0, node_path_1.join)(context.workspaceRoot, projectRoot), (0, exec_gradle_1.getGradleBinaryPath)());
|
86
85
|
targets[targetName] = {
|
87
|
-
command: `${
|
86
|
+
command: `${(0, exec_gradle_1.getGradleRelativePath)((0, node_path_1.join)(context.workspaceRoot, projectRoot))} ${task.name}`,
|
88
87
|
options: {
|
89
88
|
cwd: projectRoot,
|
90
89
|
},
|
@@ -4,4 +4,5 @@ import { ExecFileOptions } from 'child_process';
|
|
4
4
|
import { ExecFileSyncOptionsWithBufferEncoding } from 'node:child_process';
|
5
5
|
export declare function execGradle(args: string[], execOptions?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
6
6
|
export declare function getGradleBinaryPath(): string;
|
7
|
+
export declare function getGradleRelativePath(path: string): string;
|
7
8
|
export declare function execGradleAsync(args: ReadonlyArray<string>, execOptions?: ExecFileOptions): Promise<Buffer>;
|
package/src/utils/exec-gradle.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.execGradleAsync = exports.getGradleBinaryPath = exports.execGradle = void 0;
|
3
|
+
exports.execGradleAsync = exports.getGradleRelativePath = exports.getGradleBinaryPath = exports.execGradle = 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");
|
@@ -21,6 +21,17 @@ function getGradleBinaryPath() {
|
|
21
21
|
return gradleBinaryPath;
|
22
22
|
}
|
23
23
|
exports.getGradleBinaryPath = getGradleBinaryPath;
|
24
|
+
function getGradleRelativePath(path) {
|
25
|
+
const gradleBinaryPath = getGradleBinaryPath();
|
26
|
+
let relativePath = (0, node_path_1.relative)(path, gradleBinaryPath);
|
27
|
+
if (relativePath.startsWith('gradlew')) {
|
28
|
+
relativePath = process.platform.startsWith('win')
|
29
|
+
? `.\\${relativePath}`
|
30
|
+
: `./${relativePath}`;
|
31
|
+
}
|
32
|
+
return relativePath;
|
33
|
+
}
|
34
|
+
exports.getGradleRelativePath = getGradleRelativePath;
|
24
35
|
function execGradleAsync(args, execOptions) {
|
25
36
|
const gradleBinaryPath = getGradleBinaryPath();
|
26
37
|
return new Promise((res, rej) => {
|