@nx/gradle 18.2.0-canary.20240322-61cb63d → 18.2.0-canary.20240326-fb90767
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/LICENSE +1 -1
- package/package.json +2 -2
- package/src/utils/get-gradle-report.js +15 -7
package/LICENSE
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/gradle",
|
3
|
-
"version": "18.2.0-canary.
|
3
|
+
"version": "18.2.0-canary.20240326-fb90767",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Nx Plugin for gradle",
|
6
6
|
"repository": {
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"migrations": "./migrations.json"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@nx/devkit": "18.2.0-canary.
|
36
|
+
"@nx/devkit": "18.2.0-canary.20240326-fb90767"
|
37
37
|
},
|
38
38
|
"publishConfig": {
|
39
39
|
"access": "public"
|
@@ -5,6 +5,10 @@ const node_fs_1 = require("node:fs");
|
|
5
5
|
const node_path_1 = require("node:path");
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
7
7
|
const exec_gradle_1 = require("./exec-gradle");
|
8
|
+
const fileSeparator = process.platform.startsWith('win')
|
9
|
+
? 'file:///'
|
10
|
+
: 'file://';
|
11
|
+
const newLineSeparator = process.platform.startsWith('win') ? '\r\n' : '\n';
|
8
12
|
let gradleReportCache;
|
9
13
|
function invalidateGradleReportCache() {
|
10
14
|
gradleReportCache = undefined;
|
@@ -19,7 +23,7 @@ function getGradleReport() {
|
|
19
23
|
cwd: devkit_1.workspaceRoot,
|
20
24
|
})
|
21
25
|
.toString()
|
22
|
-
.split(
|
26
|
+
.split(newLineSeparator);
|
23
27
|
const gradleProjectReportEnd = performance.mark('gradleProjectReport:end');
|
24
28
|
performance.measure('gradleProjectReport', gradleProjectReportStart.name, gradleProjectReportEnd.name);
|
25
29
|
gradleReportCache = processProjectReports(projectReportLines);
|
@@ -55,13 +59,15 @@ function processProjectReports(projectReportLines) {
|
|
55
59
|
const nextLine = projectReportLines[index + 1];
|
56
60
|
if (line.endsWith(':dependencyReport')) {
|
57
61
|
const gradleProject = line.substring('> Task '.length, line.length - ':dependencyReport'.length);
|
58
|
-
const [_, file] = nextLine.split(
|
62
|
+
const [_, file] = nextLine.split(fileSeparator);
|
59
63
|
dependenciesMap.set(gradleProject, file);
|
60
64
|
}
|
61
65
|
if (line.endsWith('propertyReport')) {
|
62
66
|
const gradleProject = line.substring('> Task '.length, line.length - ':propertyReport'.length);
|
63
|
-
const [_, file] = nextLine.split(
|
64
|
-
const propertyReportLines = (0, node_fs_1.readFileSync)(file)
|
67
|
+
const [_, file] = nextLine.split(fileSeparator);
|
68
|
+
const propertyReportLines = (0, node_fs_1.readFileSync)(file)
|
69
|
+
.toString()
|
70
|
+
.split(newLineSeparator);
|
65
71
|
let projectName, absBuildFilePath, absBuildDirPath;
|
66
72
|
const outputDirMap = new Map();
|
67
73
|
for (const line of propertyReportLines) {
|
@@ -83,7 +89,7 @@ function processProjectReports(projectReportLines) {
|
|
83
89
|
if (!projectName || !absBuildFilePath || !absBuildDirPath) {
|
84
90
|
return;
|
85
91
|
}
|
86
|
-
const buildFile = (0, node_path_1.relative)(devkit_1.workspaceRoot, absBuildFilePath);
|
92
|
+
const buildFile = (0, devkit_1.normalizePath)((0, node_path_1.relative)(devkit_1.workspaceRoot, absBuildFilePath));
|
87
93
|
const buildDir = (0, node_path_1.relative)(devkit_1.workspaceRoot, absBuildDirPath);
|
88
94
|
buildFileToDepsMap.set(buildFile, dependenciesMap.get(gradleProject));
|
89
95
|
outputDirMap.set('build', `{workspaceRoot}/${buildDir}`);
|
@@ -95,9 +101,11 @@ function processProjectReports(projectReportLines) {
|
|
95
101
|
}
|
96
102
|
if (line.endsWith('taskReport')) {
|
97
103
|
const gradleProject = line.substring('> Task '.length, line.length - ':taskReport'.length);
|
98
|
-
const [_, file] = nextLine.split(
|
104
|
+
const [_, file] = nextLine.split(fileSeparator);
|
99
105
|
const taskTypeMap = new Map();
|
100
|
-
const tasksFileLines = (0, node_fs_1.readFileSync)(file)
|
106
|
+
const tasksFileLines = (0, node_fs_1.readFileSync)(file)
|
107
|
+
.toString()
|
108
|
+
.split(newLineSeparator);
|
101
109
|
let i = 0;
|
102
110
|
while (i < tasksFileLines.length) {
|
103
111
|
const line = tasksFileLines[i];
|