@nx/gradle 21.4.0-beta.0 → 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/batch-runner/build/libs/batch-runner-all.jar +0 -0
- package/batch-runner/build/libs/batch-runner.jar +0 -0
- package/migrations.json +6 -0
- package/package.json +3 -3
- package/src/executors/gradle/gradle.impl.d.ts.map +1 -1
- package/src/executors/gradle/gradle.impl.js +21 -1
- package/src/executors/gradle/schema.d.ts +1 -0
- package/src/executors/gradle/schema.json +8 -0
- package/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template +1 -1
- package/src/generators/ci-workflow/generator.d.ts.map +1 -1
- package/src/generators/ci-workflow/generator.js +8 -4
- package/src/generators/init/gradle-project-graph-plugin-utils.js +5 -1
- package/src/migrations/21-3-11/change-plugin-version-0-1-4.d.ts +3 -0
- package/src/migrations/21-3-11/change-plugin-version-0-1-4.d.ts.map +1 -0
- package/src/migrations/21-3-11/change-plugin-version-0-1-4.js +18 -0
- package/src/plugin/nodes.d.ts.map +1 -1
- package/src/plugin/nodes.js +3 -2
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
Binary file
|
Binary file
|
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.
|
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.
|
39
|
-
"nx": "21.4.0-beta.
|
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,
|
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
|
}
|
@@ -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"]
|
package/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template
CHANGED
@@ -36,7 +36,7 @@ jobs:
|
|
36
36
|
architecture: x64
|
37
37
|
|
38
38
|
- name: Setup Gradle
|
39
|
-
uses: gradle/actions/setup-gradle@
|
39
|
+
uses: gradle/actions/setup-gradle@v4
|
40
40
|
|
41
41
|
- uses: nrwl/nx-set-shas@v4
|
42
42
|
<% for (const command of commands) { %><% if (command.comments) { %><% for (const comment of command.comments) { %>
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/generators/ci-workflow/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EACL,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../packages/gradle/src/generators/ci-workflow/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EACL,MAAM,YAAY,CAAC;AA8CpB,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC1B,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAMnE;AAsCD,eAAe,mBAAmB,CAAC"}
|
@@ -11,9 +11,12 @@ function getCiCommands(ci) {
|
|
11
11
|
return [
|
12
12
|
{
|
13
13
|
comments: [
|
14
|
-
|
14
|
+
`# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected.`,
|
15
|
+
`# Change from build to build-ci if you turn on the atomizer. Learn more: https://nx.dev/nx-api/gradle#splitting-e2e-tests.`,
|
15
16
|
],
|
16
|
-
|
17
|
+
},
|
18
|
+
{
|
19
|
+
command: `./nx affected --base=$NX_BASE --head=$NX_HEAD -t build`,
|
17
20
|
},
|
18
21
|
getNxCloudFixCiCommand(),
|
19
22
|
];
|
@@ -22,9 +25,10 @@ function getCiCommands(ci) {
|
|
22
25
|
return [
|
23
26
|
{
|
24
27
|
comments: [
|
25
|
-
|
28
|
+
`# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected.`,
|
29
|
+
`# Change from build to build-ci if you turn on the atomizer. Learn more: https://nx.dev/nx-api/gradle#splitting-tests`,
|
26
30
|
],
|
27
|
-
command: `./nx affected -t
|
31
|
+
command: `./nx affected -t build`,
|
28
32
|
},
|
29
33
|
getNxCloudFixCiCommand(),
|
30
34
|
];
|
@@ -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
|
-
|
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 @@
|
|
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,
|
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"}
|
package/src/plugin/nodes.js
CHANGED
@@ -52,10 +52,11 @@ const makeCreateNodesForGradleConfigFile = (projects, projectsCache = {}, extern
|
|
52
52
|
if (!project) {
|
53
53
|
return {};
|
54
54
|
}
|
55
|
-
|
55
|
+
const normalizedProjectRoot = (0, devkit_1.normalizePath)(projectRoot);
|
56
|
+
project.root = normalizedProjectRoot;
|
56
57
|
return {
|
57
58
|
projects: {
|
58
|
-
[
|
59
|
+
[normalizedProjectRoot]: project,
|
59
60
|
},
|
60
61
|
externalNodes: externalNodes,
|
61
62
|
};
|
package/src/utils/versions.d.ts
CHANGED
@@ -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.
|
3
|
+
export declare const gradleProjectGraphVersion = "0.1.4";
|
4
4
|
//# sourceMappingURL=versions.d.ts.map
|
package/src/utils/versions.js
CHANGED
@@ -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.
|
6
|
+
exports.gradleProjectGraphVersion = '0.1.4';
|