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

Document how to enable checkUnusedDependencies #2790

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,16 @@ checkImplicitDependencies {
}
```

These tasks are created by default, but are not configured to run as part of `check`. To do that, add to the root `/build.gradle`:

```gradle
allprojects {
apply plugin: 'java-library'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this line, my internal test repo fails with:

1: Task failed with an exception.
-----------
* Where:
Build file '/Volumes/git/my-project/build.gradle' line: 77

* What went wrong:
A problem occurred evaluating root project 'my-project'.
> Could not get unknown property 'checkUnusedDependencies' for root project 'my-project' of type org.gradle.api.Project.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.

Maybe there's an alternate pattern that we should recommend instead, of only applying to subprojects that are Java type?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably wouldn't be prescriptive in this documentation about putting this in allprojects - that's something that consumers can decide for themselves.

I'd just write something like:

+ tasks.check.dependsOn tasks.checkUnusedDependencies


tasks.check.dependsOn checkUnusedDependencies, checkImplicitDependencies
}
```

## com.palantir.baseline-encoding

This plugin sets the encoding for JavaCompile tasks to `UTF-8`.
Expand Down