Skip to content

Commit

Permalink
fix(gradle): fix gradle exclude src/test
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Jun 27, 2024
1 parent 5364e27 commit ae0fdeb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions packages/gradle/src/generators/init/init.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ describe('@nx/gradle:init', () => {
});
const nxJson = readNxJson(tree);
expect(nxJson.namedInputs).toMatchInlineSnapshot(`
{
"default": [
"{projectRoot}/**/*",
],
"production": [
"default",
"!{projectRoot}/test/**/*",
],
}
`);
{
"default": [
"{projectRoot}/**/*",
],
"production": [
"default",
"!{projectRoot}/src/test/**/*",
],
}
`);
});

it('should not overwrite existing namedInputs', async () => {
Expand Down Expand Up @@ -124,6 +124,7 @@ describe('@nx/gradle:init', () => {
"!{projectRoot}/cypress.config.[jt]s",
"!{projectRoot}/test/**/*",
"default",
"!{projectRoot}/src/test/**/*",
],
}
`);
Expand Down
2 changes: 1 addition & 1 deletion packages/gradle/src/generators/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function updateNxJsonConfiguration(tree: Tree) {
);
const productionFileSet = nxJson.namedInputs.production ?? [];
nxJson.namedInputs.production = Array.from(
new Set([...productionFileSet, 'default', '!{projectRoot}/test/**/*'])
new Set([...productionFileSet, 'default', '!{projectRoot}/src/test/**/*'])
);
updateNxJson(tree, nxJson);
}
Expand Down

0 comments on commit ae0fdeb

Please sign in to comment.