@nx/gradle 21.4.0-beta.1 → 21.4.0-beta.10

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/migrations.json CHANGED
@@ -41,6 +41,12 @@
41
41
  "cli": "nx",
42
42
  "description": "Change dev.nx.gradle.project-graph to version 0.1.2 in build file",
43
43
  "factory": "./src/migrations/21-3-0/change-plugin-version-0-1-2"
44
+ },
45
+ "change-plugin-version-0-1-4": {
46
+ "version": "21.3.11-beta.0",
47
+ "cli": "nx",
48
+ "description": "Change dev.nx.gradle.project-graph to version 0.1.4 in build file",
49
+ "factory": "./src/migrations/21-3-11/change-plugin-version-0-1-4"
44
50
  }
45
51
  },
46
52
  "packageJsonUpdates": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/gradle",
3
- "version": "21.4.0-beta.1",
3
+ "version": "21.4.0-beta.10",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Gradle allows Gradle tasks to be run through Nx",
6
6
  "repository": {
@@ -35,8 +35,8 @@
35
35
  "migrations": "./migrations.json"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "21.4.0-beta.1",
39
- "nx": "21.4.0-beta.1"
38
+ "@nx/devkit": "21.4.0-beta.10",
39
+ "nx": "21.4.0-beta.10"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
@@ -1 +1 @@
1
- {"version":3,"file":"gradle.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/executors/gradle/gradle.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAMhD,wBAA8B,cAAc,CAC1C,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAyC/B"}
1
+ {"version":3,"file":"gradle.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/executors/gradle/gradle.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAMhD,wBAA8B,cAAc,CAC1C,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CA6D/B"}
@@ -17,6 +17,26 @@ async function gradleExecutor(options, context) {
17
17
  if (options.testClassName) {
18
18
  args.push(`--tests`, options.testClassName);
19
19
  }
20
+ // Pass any additional options not defined in the schema as gradle arguments
21
+ const knownOptions = new Set([
22
+ 'taskName',
23
+ 'testClassName',
24
+ 'args',
25
+ 'excludeDependsOn',
26
+ '__unparsed__',
27
+ ]);
28
+ Object.entries(options).forEach(([key, value]) => {
29
+ if (!knownOptions.has(key) && value !== undefined && value !== false) {
30
+ if (value === true) {
31
+ // Boolean flags like --continuous
32
+ args.push(`--${key}`);
33
+ }
34
+ else {
35
+ // Flags with values like --max-workers=4
36
+ args.push(`--${key}=${value}`);
37
+ }
38
+ }
39
+ });
20
40
  if (options.excludeDependsOn) {
21
41
  (0, get_exclude_task_1.getExcludeTasks)(new Set([`${context.projectName}:${context.targetName}`]), context.projectGraph.nodes).forEach((task) => {
22
42
  if (task) {
@@ -29,7 +49,7 @@ async function gradleExecutor(options, context) {
29
49
  command: `${gradlewPath} ${options.taskName}`,
30
50
  cwd: (0, node_path_1.dirname)(gradlewPath),
31
51
  args: args,
32
- __unparsed__: [],
52
+ __unparsed__: options.__unparsed__ || [],
33
53
  }, context);
34
54
  return { success };
35
55
  }
@@ -3,4 +3,5 @@ export interface GradleExecutorSchema {
3
3
  testClassName?: string;
4
4
  args?: string[] | string;
5
5
  excludeDependsOn: boolean;
6
+ __unparsed__?: string[];
6
7
  }
@@ -33,6 +33,14 @@
33
33
  "description": "If true, the tasks will not execute its dependsOn tasks (e.g. pass --exclude-task args to gradle command). If false, the task will execute its dependsOn tasks.",
34
34
  "default": true,
35
35
  "x-priority": "internal"
36
+ },
37
+ "__unparsed__": {
38
+ "type": "array",
39
+ "items": {
40
+ "type": "string"
41
+ },
42
+ "description": "Additional arguments to pass to the gradle command (automatically populated by Nx).",
43
+ "x-priority": "internal"
36
44
  }
37
45
  },
38
46
  "required": ["taskName"]
@@ -137,7 +137,11 @@ async function addNxProjectGraphPluginToBuildGradle(gradleFilePath, buildGradleC
137
137
  const applyPluginPattern = new RegExp(`\\s*plugin\\(["']${versions_1.gradleProjectGraphPluginName}["']\\)`);
138
138
  if (buildGradleContent.includes('allprojects {')) {
139
139
  if (!applyPluginPattern.test(buildGradleContent)) {
140
- devkit_1.logger.warn(`Please add the ${versions_1.gradleProjectGraphPluginName} plugin to your ${gradleFilePath}:\nallprojects {\n apply {\n plugin(\"${versions_1.gradleProjectGraphPluginName}\")\n }\n}`);
140
+ // Add plugin to existing allprojects block
141
+ const applyPlugin = isKotlinDsl
142
+ ? `plugin("${versions_1.gradleProjectGraphPluginName}")`
143
+ : `plugin "${versions_1.gradleProjectGraphPluginName}"`;
144
+ buildGradleContent = buildGradleContent.replace(/allprojects\s*\{/, `allprojects {\n apply ${applyPlugin}`);
141
145
  }
142
146
  }
143
147
  else {
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=change-plugin-version-0-1-4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-plugin-version-0-1-4.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/migrations/21-3-11/change-plugin-version-0-1-4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAM9C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,iBAS9C"}
@@ -0,0 +1,18 @@
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
+ const gradle_project_graph_plugin_utils_1 = require("../../generators/init/gradle-project-graph-plugin-utils");
7
+ /* Change the plugin version to 0.1.4
8
+ */
9
+ async function update(tree) {
10
+ const nxJson = (0, devkit_1.readNxJson)(tree);
11
+ if (!nxJson) {
12
+ return;
13
+ }
14
+ if (!(0, has_gradle_plugin_1.hasGradlePlugin)(tree)) {
15
+ return;
16
+ }
17
+ await (0, gradle_project_graph_plugin_utils_1.addNxProjectGraphPlugin)(tree, '0.1.4');
18
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../../../packages/gradle/src/plugin/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,oBAAoB,EAIpB,mBAAmB,EAEnB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAepB,OAAO,EACL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AAEvC,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAMnE,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,QAE5E;AAED,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAoC5D,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAE3C,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,EACvD,gBAAe,aAAkB,EACjC,gBAAe,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAM,KAC3D,mBAkCF,CAAC"}
1
+ {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../../../packages/gradle/src/plugin/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,oBAAoB,EAIpB,mBAAmB,EAEnB,wBAAwB,EAEzB,MAAM,YAAY,CAAC;AAepB,OAAO,EACL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AAEvC,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAMnE,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,QAE5E;AAED,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAoC5D,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAE3C,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,EACvD,gBAAe,aAAkB,EACjC,gBAAe,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAM,KAC3D,mBAmCF,CAAC"}
@@ -52,10 +52,11 @@ const makeCreateNodesForGradleConfigFile = (projects, projectsCache = {}, extern
52
52
  if (!project) {
53
53
  return {};
54
54
  }
55
- project.root = projectRoot;
55
+ const normalizedProjectRoot = (0, devkit_1.normalizePath)(projectRoot);
56
+ project.root = normalizedProjectRoot;
56
57
  return {
57
58
  projects: {
58
- [projectRoot]: project,
59
+ [normalizedProjectRoot]: project,
59
60
  },
60
61
  externalNodes: externalNodes,
61
62
  };
@@ -1,4 +1,4 @@
1
1
  export declare const nxVersion: any;
2
2
  export declare const gradleProjectGraphPluginName = "dev.nx.gradle.project-graph";
3
- export declare const gradleProjectGraphVersion = "0.1.0";
3
+ export declare const gradleProjectGraphVersion = "0.1.4";
4
4
  //# sourceMappingURL=versions.d.ts.map
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.gradleProjectGraphVersion = exports.gradleProjectGraphPluginName = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
5
  exports.gradleProjectGraphPluginName = 'dev.nx.gradle.project-graph';
6
- exports.gradleProjectGraphVersion = '0.1.0';
6
+ exports.gradleProjectGraphVersion = '0.1.4';