Skip to content

Commit

Permalink
Add Gradle installation instructions to README (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghokun authored Feb 13, 2023
1 parent 0f15070 commit 0cb03aa
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ code_][picnic-blog-ep-post].
### Installation

This library is built on top of [Error Prone][error-prone-orig-repo]. To use
it:
it, read the installation guide for Maven or Gradle below.

#### Maven

1. First, follow Error Prone's [installation
guide][error-prone-installation-guide].
Expand Down Expand Up @@ -94,6 +96,31 @@ it:
Prone Support. Alternatively reference this project's `self-check` profile
definition. -->

#### Gradle

1. First, follow the [installation guide]
[error-prone-gradle-installation-guide] of the `gradle-errorprone-plugin`.
2. Next, edit your `build.gradle` file to add one or more Error Prone Support
modules:

```groovy
dependencies {
// Error Prone itself.
errorprone("com.google.errorprone:error_prone_core:${errorProneVersion}")
// Error Prone Support's additional bug checkers.
errorprone("tech.picnic.error-prone-support:error-prone-contrib:${errorProneSupportVersion}")
// Error Prone Support's Refaster rules.
errorprone("tech.picnic.error-prone-support:refaster-runner:${errorProneSupportVersion}")
}
tasks.withType(JavaCompile).configureEach {
options.errorprone.disableWarningsInGeneratedCode = true
// Add other Error Prone flags here. See:
// - https://github.com/tbroyer/gradle-errorprone-plugin#configuration
// - https://errorprone.info/docs/flags
}
```

### Seeing it in action

Consider the following example code:
Expand Down Expand Up @@ -207,6 +234,7 @@ guidelines][contributing].
[error-prone-bugchecker]: https://github.com/google/error-prone/blob/master/check_api/src/main/java/com/google/errorprone/bugpatterns/BugChecker.java
[error-prone-fork-jitpack]: https://jitpack.io/#PicnicSupermarket/error-prone
[error-prone-fork-repo]: https://github.com/PicnicSupermarket/error-prone
[error-prone-gradle-installation-guide]: https://github.com/tbroyer/gradle-errorprone-plugin
[error-prone-installation-guide]: https://errorprone.info/docs/installation#maven
[error-prone-orig-repo]: https://github.com/google/error-prone
[error-prone-pull-3301]: https://github.com/google/error-prone/pull/3301
Expand Down

0 comments on commit 0cb03aa

Please sign in to comment.