Skip to content

Commit

Permalink
Add installation instructions for Gradle (groovy)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghokun committed Dec 30, 2022
1 parent 601fcf2 commit 83499e4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ code_][picnic-blog-ep-post].
This library is built on top of [Error Prone][error-prone-orig-repo]. To use
it:

#### Maven

1. First, follow Error Prone's [installation
guide][error-prone-installation-guide].
2. Next, edit your `pom.xml` file to add one or more Error Prone Support
Expand Down Expand Up @@ -94,6 +96,33 @@ it:
Prone Support. Alternatively reference this project's `self-check` profile
definition. -->

#### Gradle (Groovy)

- Add `net.ltgt.errorprone` plugin to your `build.gradle` file with one or
more Error Prone Support modules:

```groovy
plugins {
// The gradle plugin is an external contribution.
// The documentation and code is at: https://github.com/tbroyer/gradle-errorprone-plugin
id("net.ltgt.errorprone") version "${errorPronePluginVersion}"
}
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}")
}
// Configure Error Prone
tasks.withType(JavaCompile).configureEach {
options.errorprone.disableWarningsInGeneratedCode = true
}
```

### Seeing it in action

Consider the following example code:
Expand Down

0 comments on commit 83499e4

Please sign in to comment.