Skip to content

Commit

Permalink
When building AutoFactory, pick up AutoService via `<annotationProces…
Browse files Browse the repository at this point in the history
…sorPaths>`.

The annotation dependency for `@AutoService` is now a regular compile-scoped dependency. This prevents errors from overeager consumers that can't deal with missing annotation class files.

This change is equivalent to the one we made for AutoValue in #1046.

Fixes #744.

RELNOTES=AutoService dependency is now a regular compile-scoped dependency.
PiperOrigin-RevId: 367219456
  • Loading branch information
eamonnmcmanus authored and Google Java Core Libraries committed Apr 7, 2021
1 parent 61eda8c commit 52279ea
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions factory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<auto-service.version>1.0</auto-service.version>
<auto-value.version>1.8</auto-value.version>
<java.version>1.8</java.version>
<guava.version>30.1.1-jre</guava.version>
Expand Down Expand Up @@ -77,17 +78,10 @@
<artifactId>auto-value-annotations</artifactId>
<version>${auto-value.version}</version>
</dependency>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.0</version>
<scope>provided</scope>
<artifactId>auto-service-annotations</artifactId>
<version>${auto-service.version}</version>
</dependency>
<dependency>
<groupId>net.ltgt.gradle.incap</groupId>
Expand Down Expand Up @@ -160,6 +154,18 @@
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>${auto-service.version}</version>
</path>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
<dependencies>
<dependency>
Expand Down

0 comments on commit 52279ea

Please sign in to comment.