Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@nx/gradle plugin - 19.6.4 -> 20.0.12 - include pattern needs to declare 'gradlew' in nx.json #28865

Open
1 of 4 tasks
RobbyRabbitman opened this issue Nov 10, 2024 · 0 comments
Assignees
Labels
scope: java Issues related to Java and Gradle type: bug

Comments

@RobbyRabbitman
Copy link

Current Behavior

After migrating from 19.6.4 to 20.0.12 the @nx/gradle plugin did not infer targets anymore.

{
  "plugin": "@nx/gradle",
  "options": {
    "testTargetName": "test-vaadin-flow",
    "classesTargetName": "classes-vaadin-flow",
    "buildTargetName": "build-vaadin-flow"
  },
  "include": ["**/vaadin-flow/**/*"]
}

Seems like #27645 affected it: splitConfigFiles() splits the files matched by gradleConfigAndTestGlob but I guess the **/vaadin-flow/**/* glob filters out my root gradlew, therefore splitConfigFiles() returns an empty array for the found gradlew files. The empty array is then passed to populateGradleReport() which reports an empty report and eventually makeCreateNodesForGradleConfigFile() takes that empty report and creates no nodes (?) - thats my guess from looking at the PR - idk how to debug it actually.

After adding the gradlew to the include property it worked:

{
      "plugin": "@nx/gradle",
      "options": {
        "testTargetName": "test-vaadin-flow",
        "classesTargetName": "classes-vaadin-flow",
        "buildTargetName": "build-vaadin-flow"
      },
      "include": ["gradlew", "**/vaadin-flow/**/*"]
    }

Expected Behavior

Idk if that is a user error or if for example the plugin should check for some common locations for gradlew files, regardless of the matched files by the gradleConfigAndTestGlob glob, because it may operate on a subset due to include and exclude properties in the plugin declaration.

What are your thoughts on this one?

GitHub Repo

No response

Steps to Reproduce

Nx Report

NX   Report complete - copy this into the issue template

Node           : 20.17.0
OS             : linux-arm64
Native Target  : aarch64-linux
pnpm           : 9.12.2

nx                      : 20.0.12
@nx/js                  : 20.0.12
@nrwl/js                : 19.6.4
@nx/linter              : 19.6.4
@nx/eslint              : 20.0.12
@nx/workspace           : 20.0.12
@nrwl/workspace         : 19.6.4
@nx/angular             : 20.0.12
@nrwl/angular           : 19.6.4
@nx/cypress             : 20.0.12
@nrwl/cypress           : 19.6.4
@nx/devkit              : 20.0.12
@nrwl/devkit            : 19.6.4
@nx/eslint-plugin       : 20.0.12
@nrwl/eslint-plugin-nx  : 19.6.4
@nx/gradle              : 20.0.12
@nx/storybook           : 20.0.12
@nrwl/storybook         : 19.6.4
@nrwl/tao               : 19.6.4
@nx/vite                : 20.0.12
@nrwl/vite              : 19.6.4
@nx/web                 : 20.0.12
@nrwl/web               : 19.6.4
@nx/webpack             : 20.0.12
@nrwl/webpack           : 19.6.4
typescript              : 5.4.4
---------------------------------------
Registered Plugins:
@hdi-components/tools-tsc-plugin
@hdi-components/tools-web-test-runner-plugin
@hdi-components/tools-storybook-test-plugin
@hdi-components/tools-stylelint-plugin
@nx/eslint/plugin
@nx/vite/plugin
@hdi-components/tools-sonar-scan-plugin
@nx/storybook/plugin
@nx/gradle
---------------------------------------
Community plugins:
@compodoc/compodoc : 1.1.25
@storybook/angular : 8.3.6
---------------------------------------
Local workspace plugins:
         @hdi-components/tools-publish
         @hdi-components/tools-release
         @hdi-components/tools-docker
---------------------------------------
The following packages should match the installed version of nx
  - @nrwl/js@19.6.4
  - @nx/linter@19.6.4
  - @nrwl/workspace@19.6.4
  - @nrwl/angular@19.6.4
  - @nrwl/cypress@19.6.4
  - @nrwl/devkit@19.6.4
  - @nrwl/eslint-plugin-nx@19.6.4
  - @nrwl/storybook@19.6.4
  - @nrwl/tao@19.6.4
  - @nrwl/vite@19.6.4
  - @nrwl/web@19.6.4
  - @nrwl/webpack@19.6.4

To fix this, run `nx migrate nx@20.0.12`

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@FrozenPandaz FrozenPandaz added the scope: java Issues related to Java and Gradle label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: java Issues related to Java and Gradle type: bug
Projects
None yet
Development

No branches or pull requests

3 participants