@nx/gradle 20.5.0-beta.1 → 20.5.0-beta.3
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.5.0-beta.
|
|
3
|
+
"version": "20.5.0-beta.3",
|
|
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.5.0-beta.
|
|
37
|
+
"@nx/devkit": "20.5.0-beta.3"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
@@ -21,14 +21,16 @@ 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
|
-
|
|
24
|
+
if (targetProjectName) {
|
|
25
|
+
const dependency = {
|
|
26
|
+
source: projectName,
|
|
27
|
+
target: targetProjectName,
|
|
28
|
+
type: devkit_1.DependencyType.static,
|
|
29
|
+
sourceFile: gradleFile,
|
|
30
|
+
};
|
|
31
|
+
(0, devkit_1.validateDependency)(dependency, context);
|
|
32
|
+
dependencies.add(dependency);
|
|
33
|
+
}
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
36
|
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,6 +7,7 @@ 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");
|
|
10
11
|
/**
|
|
11
12
|
* For gradle command, it needs to be run from the directory of the gradle binary
|
|
12
13
|
* @returns gradle binary file name
|
|
@@ -28,6 +29,7 @@ function execGradleAsync(gradleBinaryPath, args, execOptions = {}) {
|
|
|
28
29
|
shell: true,
|
|
29
30
|
windowsHide: true,
|
|
30
31
|
env: process.env,
|
|
32
|
+
maxBuffer: run_commands_impl_1.LARGE_BUFFER,
|
|
31
33
|
...execOptions,
|
|
32
34
|
});
|
|
33
35
|
let stdout = Buffer.from('');
|
|
@@ -264,11 +264,12 @@ function processGradleDependencies(depsFile) {
|
|
|
264
264
|
targetProjectName = dep
|
|
265
265
|
.substring('project '.length)
|
|
266
266
|
.replace(/ \(n\)$/, '')
|
|
267
|
-
.trim()
|
|
267
|
+
.trim()
|
|
268
|
+
.split(' ')?.[0];
|
|
268
269
|
}
|
|
269
270
|
else if (dep.includes('-> project')) {
|
|
270
271
|
const [_, projectName] = dep.split('-> project');
|
|
271
|
-
targetProjectName = projectName.trim();
|
|
272
|
+
targetProjectName = projectName.trim().split(' ')?.[0];
|
|
272
273
|
}
|
|
273
274
|
if (targetProjectName) {
|
|
274
275
|
dependedProjects.add(targetProjectName);
|
|
@@ -28,6 +28,7 @@ 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' : '',
|
|
31
32
|
]);
|
|
32
33
|
}
|
|
33
34
|
catch (e) {
|
|
@@ -64,8 +65,15 @@ async function getProjectReportLines(gradlewFile) {
|
|
|
64
65
|
], []);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
const projectReportLines = projectReportBuffer
|
|
68
69
|
.toString()
|
|
69
70
|
.split(exports.newLineSeparator)
|
|
70
71
|
.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;
|
|
71
79
|
}
|