@nx/gradle 21.4.0-canary.20250805-990c6f6 → 21.4.0-canary.20250808-c60258e

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": "21.4.0-canary.20250805-990c6f6",
3
+ "version": "21.4.0-canary.20250808-c60258e",
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-canary.20250805-990c6f6",
39
- "nx": "21.4.0-canary.20250805-990c6f6"
38
+ "@nx/devkit": "21.4.0-canary.20250808-c60258e",
39
+ "nx": "21.4.0-canary.20250808-c60258e"
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 {
@@ -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
  };