@nx/gradle 21.7.0-canary.20250930-e144408 → 22.0.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.
@@ -1,10 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- /**
3
- * This migration adds task `projectReportAll` to build.gradle files
4
- */
5
- export default function update(tree: Tree): Promise<void>;
6
- /**
7
- * This function creates and populate build.gradle file next to the settings.gradle file.
8
- */
9
- export declare function addBuildGradleFileNextToSettingsGradle(tree: Tree): Promise<void>;
10
- //# sourceMappingURL=add-project-report-all.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-project-report-all.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/migrations/19-4-0/add-project-report-all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,MAAM,YAAY,CAAC;AAGrD;;GAEG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,iBAE9C;AAED;;GAEG;AACH,wBAAsB,sCAAsC,CAAC,IAAI,EAAE,IAAI,iBAOtE"}
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = update;
4
- exports.addBuildGradleFileNextToSettingsGradle = addBuildGradleFileNextToSettingsGradle;
5
- const devkit_1 = require("@nx/devkit");
6
- const node_path_1 = require("node:path");
7
- /**
8
- * This migration adds task `projectReportAll` to build.gradle files
9
- */
10
- async function update(tree) {
11
- await addBuildGradleFileNextToSettingsGradle(tree);
12
- }
13
- /**
14
- * This function creates and populate build.gradle file next to the settings.gradle file.
15
- */
16
- async function addBuildGradleFileNextToSettingsGradle(tree) {
17
- const settingsGradleFiles = await (0, devkit_1.globAsync)(tree, [
18
- '**/settings.gradle?(.kts)',
19
- ]);
20
- settingsGradleFiles.forEach((settingsGradleFile) => {
21
- addProjectReportToBuildGradle(settingsGradleFile, tree);
22
- });
23
- }
24
- /**
25
- * - creates a build.gradle file next to the settings.gradle file if it does not exist.
26
- * - adds the project-report plugin to the build.gradle file if it does not exist.
27
- * - adds a task to generate project reports for all subprojects and included builds.
28
- */
29
- function addProjectReportToBuildGradle(settingsGradleFile, tree) {
30
- const filename = (0, node_path_1.basename)(settingsGradleFile);
31
- let gradleFilePath = 'build.gradle';
32
- if (filename.endsWith('.kts')) {
33
- gradleFilePath = 'build.gradle.kts';
34
- }
35
- gradleFilePath = (0, node_path_1.join)((0, node_path_1.dirname)(settingsGradleFile), gradleFilePath);
36
- let buildGradleContent = '';
37
- if (!tree.exists(gradleFilePath)) {
38
- tree.write(gradleFilePath, buildGradleContent); // create a build.gradle file near settings.gradle file if it does not exist
39
- }
40
- else {
41
- buildGradleContent = tree.read(gradleFilePath).toString();
42
- }
43
- if (buildGradleContent.includes('allprojects')) {
44
- if (!buildGradleContent.includes('"project-report"')) {
45
- devkit_1.logger.warn(`Please add the project-report plugin to your ${gradleFilePath}:
46
- allprojects {
47
- apply {
48
- plugin("project-report")
49
- }
50
- }`);
51
- }
52
- }
53
- else {
54
- buildGradleContent += `\n\rallprojects {
55
- apply {
56
- plugin("project-report")
57
- }
58
- }`;
59
- }
60
- if (!buildGradleContent.includes(`tasks.register("projectReportAll")`)) {
61
- if (gradleFilePath.endsWith('.kts')) {
62
- buildGradleContent += `\n\rtasks.register("projectReportAll") {
63
- // All project reports of subprojects
64
- allprojects.forEach {
65
- dependsOn(it.tasks.get("projectReport"))
66
- }
67
-
68
- // All projectReportAll of included builds
69
- gradle.includedBuilds.forEach {
70
- dependsOn(it.task(":projectReportAll"))
71
- }
72
- }`;
73
- }
74
- else {
75
- buildGradleContent += `\n\rtasks.register("projectReportAll") {
76
- // All project reports of subprojects
77
- allprojects.forEach {
78
- dependsOn(it.tasks.getAt("projectReport"))
79
- }
80
-
81
- // All projectReportAll of included builds
82
- gradle.includedBuilds.forEach {
83
- dependsOn(it.task(":projectReportAll"))
84
- }
85
- }`;
86
- }
87
- }
88
- if (buildGradleContent) {
89
- tree.write(gradleFilePath, buildGradleContent);
90
- }
91
- }
@@ -1,3 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function update(tree: Tree): void;
3
- //# sourceMappingURL=change-regex-test-production.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"change-regex-test-production.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/migrations/19-4-1/change-regex-test-production.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA4B,MAAM,YAAY,CAAC;AAI5D,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,IAAI,EAAE,IAAI,QAcxC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = update;
4
- const devkit_1 = require("@nx/devkit");
5
- const has_gradle_plugin_1 = require("../../utils/has-gradle-plugin");
6
- // This function changes !{projectRoot}/test/**/* in nx.json for production to !{projectRoot}/src/test/**/*
7
- function update(tree) {
8
- if (!(0, has_gradle_plugin_1.hasGradlePlugin)(tree)) {
9
- return;
10
- }
11
- const nxJson = (0, devkit_1.readNxJson)(tree);
12
- if (!nxJson) {
13
- return;
14
- }
15
- const production = nxJson.namedInputs?.production;
16
- if (production?.includes('!{projectRoot}/test/**/*')) {
17
- production[production.indexOf('!{projectRoot}/test/**/*')] =
18
- '!{projectRoot}/src/test/**/*';
19
- (0, devkit_1.updateNxJson)(tree, nxJson);
20
- }
21
- }