Skip to content

Commit 64b2396

Browse files
authored
fix(gradle): fix gradle plugin path (#22405)
1 parent a44475c commit 64b2396

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

packages/gradle/src/generators/init/init.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('@nx/gradle:init', () => {
2525
"classesTargetName": "classes",
2626
"testTargetName": "test",
2727
},
28-
"plugin": "@nx/gradle/plugin",
28+
"plugin": "@nx/gradle",
2929
},
3030
]
3131
`);
@@ -49,15 +49,15 @@ describe('@nx/gradle:init', () => {
4949
"classesTargetName": "classes",
5050
"testTargetName": "test",
5151
},
52-
"plugin": "@nx/gradle/plugin",
52+
"plugin": "@nx/gradle",
5353
},
5454
]
5555
`);
5656
});
5757

5858
it('should not add plugin if already in array', async () => {
5959
updateNxJson(tree, {
60-
plugins: ['@nx/gradle/plugin'],
60+
plugins: ['@nx/gradle'],
6161
});
6262
await initGenerator(tree, {
6363
skipFormat: true,
@@ -66,7 +66,7 @@ describe('@nx/gradle:init', () => {
6666
const nxJson = readNxJson(tree);
6767
expect(nxJson.plugins).toMatchInlineSnapshot(`
6868
[
69-
"@nx/gradle/plugin",
69+
"@nx/gradle",
7070
]
7171
`);
7272
});

packages/gradle/src/generators/init/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function addPlugin(tree: Tree) {
5151
if (!hasGradlePlugin(tree)) {
5252
nxJson.plugins ??= [];
5353
nxJson.plugins.push({
54-
plugin: '@nx/gradle/plugin',
54+
plugin: '@nx/gradle',
5555
options: {
5656
testTargetName: 'test',
5757
classesTargetName: 'classes',

packages/gradle/src/utils/has-gradle-plugin.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { readNxJson, Tree } from '@nx/devkit';
33
export function hasGradlePlugin(tree: Tree): boolean {
44
const nxJson = readNxJson(tree);
55
return !!nxJson.plugins?.some((p) =>
6-
typeof p === 'string'
7-
? p === '@nx/gradle/plugin'
8-
: p.plugin === '@nx/gradle/plugin'
6+
typeof p === 'string' ? p === '@nx/gradle' : p.plugin === '@nx/gradle'
97
);
108
}

0 commit comments

Comments
 (0)