Skip to content

Commit

Permalink
chore: enable profile for AutoValue (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 committed Aug 4, 2020
1 parent c9f528b commit 7fae646
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 12 deletions.
Empty file added oauth2_http/EnableAutoValue.txt
Empty file.
99 changes: 87 additions & 12 deletions pom.xml
Expand Up @@ -66,6 +66,7 @@
<project.autovalue.version>1.7.4</project.autovalue.version>
<project.findbugs.version>3.0.2</project.findbugs.version>
<deploy.autorelease>false</deploy.autorelease>
<auto-value-annotation.version>1.7.4</auto-value-annotation.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -102,16 +103,16 @@
<artifactId>guava</artifactId>
<version>${project.guava.version}</version>
</dependency>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value-annotations</artifactId>
<version>${project.autovalue.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>${project.findbugs.version}</version>
</dependency>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value-annotations</artifactId>
<version>${auto-value-annotation.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down Expand Up @@ -231,13 +232,6 @@
<target>1.7</target>
<encoding>UTF-8</encoding>
<compilerArgument>-Xlint:unchecked</compilerArgument>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${project.autovalue.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -428,5 +422,86 @@
</plugins>
</build>
</profile>
<profile>
<id>autovalue-java7</id>
<activation>
<jdk>1.7</jdk>
<file>
<exists>${basedir}/EnableAutoValue.txt</exists>
</file>
</activation>
<properties>
<!--
We need to back pin to 1.4 because it is the last version of auto-value
that was compiled for java 1.7.
-->
<auto-value.version>1.4</auto-value.version>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value.version}</version>
</path>
<!--
There is currently no available version of auto-service-annotations
in maven central compiled for java 1.7, so we can't include it here.
If you're using IntelliJ please use a newer jdk and set the language
level to 1.7 for your dev work.
-->
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>autovalue-java8</id>
<activation>
<jdk>[1.8,)</jdk>
<file>
<exists>${basedir}/EnableAutoValue.txt</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value-annotation.version}</version>
</path>
<!--
Manually pull in auto-service-annotations so that it is part of the
processor path because auto-value has it set to provided scope.
This dependency is needed due to the retention change in
https://github.com/google/auto/commit/628df548685b4fc0f2a9af856f97cc2a68da246b
where the RetentionPolicy changed from SOURCE to CLASS.
Due to the RetentionPolicy change to CLASS we must have the
annotations available on the processor path otherwise the following
error will be thrown. (This is a particular problem with the
annotation processor configuration in IntelliJ)
Error:java: java.lang.NoClassDefFoundError: com/google/auto/service/AutoService
com.google.auto.service.AutoService
-->
<path>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service-annotations</artifactId>
<version>1.0-rc7</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 7fae646

Please sign in to comment.