Emily Xiong 7a53477adc
fix(gradle): fix gradle test running gaps (#31313)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
- for the atomized test, currenly, its testClassName is just the 1st
class name in the file

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- upgrade gradle to latest version from 8.13 to 8.14
- for test task, exclude all its depends on tasks
  - it currently only exclude its direct depends on, its children
- now it will go down the dependency tree and exclude all of its depends
on, its children and grandchildren
- for the atomized test target, its testClassName will be the full
package name
- e.g.
org.springframework.boot.autoconfigure.jersey.JerseyAutoConfigurationCustomObjectMapperProviderTest
   - add logics to handle nested class
   - exclude private class name
<img width="1081" alt="Screenshot 2025-06-06 at 2 53 39 PM"
src="https://github.com/user-attachments/assets/285792fb-f098-4511-85dc-ee1263d75929"
/>
- add build-ci target
<img width="1140" alt="Screenshot 2025-06-10 at 10 21 06 AM"
src="https://github.com/user-attachments/assets/25db4a3e-2794-4654-9a95-1b66d229340b"
/>


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-06-10 13:23:09 -04:00

987 B

dev.nx.gradle.project-graph

This gradle plugin contains

Installation

Kotlin build.gradle.kts

plugins {
    id("dev.nx.gradle.project-graph") version("+")
}

Groovy build.gradle

plugins {
    id "dev.nx.gradle.project-graph" version "+"
}

Usage

./gradlew nxProjectGraph

In terminal, it should output something like:

> Task :nxProjectGraph
< your workspace >/build/nx/add-nx-to-gradle.json

To pass in a hash parameter:

./gradlew nxProjectGraph -Phash=12345

To control whether Nx generates individual targets for each Gradle task (atomized targets) or a single target for the entire Gradle project, set the atomized boolean in your build.gradle or build.gradle.kts file.

To disable atomized targets:

nxProjectReport {
  atomized = false
}

It generates a json file to be consumed by nx:

{
  "nodes": {
    "app": {
      "targets": {}
    }
  },
  "dependencies": [],
  "externalNodes": {}
}