Skip to content

Commit

Permalink
Suggest compileOnlyApi rather than compile for AutoValue with Gra…
Browse files Browse the repository at this point in the history
…dle.

Since `compileOnlyApi` is a recent feature, continue to mention the old way in a note.

Fixes #995.

RELNOTES=n/a
PiperOrigin-RevId: 362995141
  • Loading branch information
eamonnmcmanus authored and Google Java Core Libraries committed Mar 15, 2021
1 parent cdbae35 commit 6fc8074
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions value/userguide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,15 @@ Gradle users can declare the dependencies in their `build.gradle` script:

```groovy
dependencies {
// Use 'api' rather than 'compile' for Android or java-library projects.
compile "com.google.auto.value:auto-value-annotations:${autoValueVersion}"
compileOnlyApi "com.google.auto.value:auto-value-annotations:${autoValueVersion}"
annotationProcessor "com.google.auto.value:auto-value:${autoValueVersion}"
}
```

Note: If you are using a version of Gradle prior to 4.6, you must apply an
annotation processing plugin [as described in these instructions][tbroyer-apt].
Note: If you are using a version of Gradle prior to 6.7, use `compile` or (for
Android or java-library projects) `api` instead of `compileOnlyApi`. If you are
using a version prior to 4.6, you must apply an annotation processing plugin
[as described in these instructions][tbroyer-apt].

[tbroyer-apt]: https://plugins.gradle.org/plugin/net.ltgt.apt

Expand Down

0 comments on commit 6fc8074

Please sign in to comment.