@nx/gradle 20.4.4 → 20.5.0-beta.1
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": "20.
|
|
3
|
+
"version": "20.5.0-beta.1",
|
|
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": "20.
|
|
37
|
+
"@nx/devkit": "20.5.0-beta.1"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
@@ -21,16 +21,14 @@ const createDependencies = async (_, context) => {
|
|
|
21
21
|
dependedProjects?.forEach((dependedProject) => {
|
|
22
22
|
const targetProjectRoot = gradleProjectNameToProjectRootMap.get(dependedProject);
|
|
23
23
|
const targetProjectName = Object.values(context.projects).find((project) => project.root === targetProjectRoot)?.name;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
dependencies.add(dependency);
|
|
33
|
-
}
|
|
24
|
+
const dependency = {
|
|
25
|
+
source: projectName,
|
|
26
|
+
target: targetProjectName,
|
|
27
|
+
type: devkit_1.DependencyType.static,
|
|
28
|
+
sourceFile: gradleFile,
|
|
29
|
+
};
|
|
30
|
+
(0, devkit_1.validateDependency)(dependency, context);
|
|
31
|
+
dependencies.add(dependency);
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
34
|
gradleProjectToChildProjects.get(gradleProject)?.forEach((childProject) => {
|
package/src/plugin/nodes.js
CHANGED
|
@@ -94,7 +94,7 @@ async function createGradleProject(gradleReport, gradleFilePath, options, contex
|
|
|
94
94
|
let tasks = [];
|
|
95
95
|
tasksSet.forEach((taskName) => {
|
|
96
96
|
tasks.push({
|
|
97
|
-
type: tasksTypeMap
|
|
97
|
+
type: tasksTypeMap.get(taskName),
|
|
98
98
|
name: taskName,
|
|
99
99
|
});
|
|
100
100
|
});
|
package/src/utils/exec-gradle.js
CHANGED
|
@@ -7,7 +7,6 @@ const devkit_1 = require("@nx/devkit");
|
|
|
7
7
|
const node_child_process_1 = require("node:child_process");
|
|
8
8
|
const node_fs_1 = require("node:fs");
|
|
9
9
|
const node_path_1 = require("node:path");
|
|
10
|
-
const run_commands_impl_1 = require("nx/src/executors/run-commands/run-commands.impl");
|
|
11
10
|
/**
|
|
12
11
|
* For gradle command, it needs to be run from the directory of the gradle binary
|
|
13
12
|
* @returns gradle binary file name
|
|
@@ -29,7 +28,6 @@ function execGradleAsync(gradleBinaryPath, args, execOptions = {}) {
|
|
|
29
28
|
shell: true,
|
|
30
29
|
windowsHide: true,
|
|
31
30
|
env: process.env,
|
|
32
|
-
maxBuffer: run_commands_impl_1.LARGE_BUFFER,
|
|
33
31
|
...execOptions,
|
|
34
32
|
});
|
|
35
33
|
let stdout = Buffer.from('');
|
|
@@ -264,12 +264,11 @@ function processGradleDependencies(depsFile) {
|
|
|
264
264
|
targetProjectName = dep
|
|
265
265
|
.substring('project '.length)
|
|
266
266
|
.replace(/ \(n\)$/, '')
|
|
267
|
-
.trim()
|
|
268
|
-
.split(' ')?.[0];
|
|
267
|
+
.trim();
|
|
269
268
|
}
|
|
270
269
|
else if (dep.includes('-> project')) {
|
|
271
270
|
const [_, projectName] = dep.split('-> project');
|
|
272
|
-
targetProjectName = projectName.trim()
|
|
271
|
+
targetProjectName = projectName.trim();
|
|
273
272
|
}
|
|
274
273
|
if (targetProjectName) {
|
|
275
274
|
dependedProjects.add(targetProjectName);
|
|
@@ -28,7 +28,6 @@ async function getProjectReportLines(gradlewFile) {
|
|
|
28
28
|
try {
|
|
29
29
|
projectReportBuffer = await (0, exec_gradle_1.execGradleAsync)(gradlewFile, [
|
|
30
30
|
'projectReportAll',
|
|
31
|
-
process.env.NX_VERBOSE_LOGGING === 'true' ? '--info' : '',
|
|
32
31
|
]);
|
|
33
32
|
}
|
|
34
33
|
catch (e) {
|
|
@@ -65,15 +64,8 @@ async function getProjectReportLines(gradlewFile) {
|
|
|
65
64
|
], []);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
|
-
|
|
67
|
+
return projectReportBuffer
|
|
69
68
|
.toString()
|
|
70
69
|
.split(exports.newLineSeparator)
|
|
71
70
|
.filter((line) => line.trim() !== '');
|
|
72
|
-
if (process.env.NX_VERBOSE_LOGGING === 'true') {
|
|
73
|
-
devkit_1.output.log({
|
|
74
|
-
title: `Successfully ran projectReportAll or projectRerport task using ${gradlewFile}`,
|
|
75
|
-
bodyLines: projectReportLines,
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return projectReportLines;
|
|
79
71
|
}
|