Skip to content

Commit

Permalink
Add example of using DEPENDENCY_GRAPH_INCLUDE_PROJECTS to docs (#844)
Browse files Browse the repository at this point in the history
Users will currently need to spend some time working out the required regex when using `DEPENDENCY_GRAPH_INCLUDE_PROJECTS`. Providing an example will get users up to speed quicker.

Signed-off-by: Andy Coates <8012398+big-andy-coates@users.noreply.github.com>
  • Loading branch information
big-andy-coates authored Aug 16, 2023
1 parent 337198a commit 4283247
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ You can provide this value via the `DEPENDENCY_GRAPH_INCLUDE_PROJECTS` environme
To restrict which Gradle configurations contribute to the report, you can filter configurations by name using a regular expression.
You can provide this value via the `DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS` environment variable or system property.

Example of a simple workflow that limits the dependency graph to `runtimeClasspath` configuration:
Example of a simple workflow that limits the dependency graph to `runtimeClasspath` configuration and to exclude `buildSrc` dependencies:

```yaml
name: Submit dependency graph
on:
Expand All @@ -480,7 +481,10 @@ jobs:
with:
dependency-graph: generate-and-submit
- name: Run a build, generating the dependency graph from 'runtimeClasspath' configurations
run: ./gradlew build -DDEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS=runtimeClasspath
run: ./gradlew build
env:
DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS: runtimeClasspath
DEPENDENCY_GRAPH_INCLUDE_PROJECTS: "^:(?!buildSrc).*"
```

### Gradle version compatibility
Expand Down

0 comments on commit 4283247

Please sign in to comment.