Skip to content

Commit

Permalink
Use CLASS retention for @autoservice
Browse files Browse the repository at this point in the history
Gradle incremental aggregating processors require all processed annotations to have CLASS retention so that the incremental compiler can substitute a class file for a source file if the file is unchanged. With SOURCE retention, Gradle requires a full rebuild.

See:
#615
https://docs.gradle.org/6.0.1/userguide/java_plugin.html#aggregating_annotation_processors
https://github.com/gradle/gradle/blob/v6.0.1/subprojects/language-java/src/main/java/org/gradle/api/internal/tasks/compile/processing/AggregatingProcessingStrategy.java#L49-L56

RELNOTES=`AutoService`: Use `CLASS` retention to support Gradle aggregating incremental annotation processors

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=282380619
  • Loading branch information
ember-rose authored and nick-someone committed Nov 25, 2019
1 parent 66c0599 commit 5eebb1b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.google.auto.service;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import static java.lang.annotation.RetentionPolicy.CLASS;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
Expand All @@ -36,7 +36,7 @@
* </ul>
*/
@Documented
@Retention(SOURCE)
@Retention(CLASS)
@Target(TYPE)
public @interface AutoService {
/** Returns the interfaces implemented by this service provider. */
Expand Down

0 comments on commit 5eebb1b

Please sign in to comment.