google / auto

A collection of source code generators for Java.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change retention of AutoAnnotation to CLASS to make it compatible with Gradle incremental compiler

asodja opened this issue · comments

We got a report that "isolating" processors might not produce correct results when combined with "aggregating" processors with the Gradle incremental compilation. In case the "isolating" processor and "aggregating" processor work on the same type, then all annotations have to have CLASS or RUNTIME retention, and not just SOURCE. This is a rare case that was forgotten when documentation was written. Check for details: gradle/gradle#19366.

We noticed that one of your annotations is using SOURCE retention:

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.SOURCE)
public @interface AutoAnnotation {}

So to be 100% compatible with the Gradle incremental compilation, you should change that to CLASS retention.

This looks like an oversight. The other annotations in the same package have all moved from SOURCE to CLASS retention over time, but this one was missed.