Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoFactory adds unwanted AutoValue annotation processors to classpath #744

Closed
technoir42 opened this issue Jul 30, 2019 · 3 comments · Fixed by #1052
Closed

AutoFactory adds unwanted AutoValue annotation processors to classpath #744

technoir42 opened this issue Jul 30, 2019 · 3 comments · Fixed by #1052
Assignees
Labels
Component: factory P3 type=other Miscellaneous activities not covered by other type= labels

Comments

@technoir42
Copy link

AutoFactory 1.0-beta6 has a compile-scoped dependency on AutoValue 1.5.3:

auto/factory/pom.xml

Lines 74 to 78 in 2a52c55

<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>1.5.3</version>
</dependency>

which adds the following annotation processors to classpath:

com.google.auto.value.extension.memoized.MemoizedValidator
com.google.auto.value.processor.AutoAnnotationProcessor
com.google.auto.value.processor.AutoValueBuilderProcessor
com.google.auto.value.processor.AutoValueProcessor

This is problematic for two reasons:

  1. AutoValue 1.5.3 doesn't support incap thus incap has to be disabled for the whole Gradle module.
  2. Consumers of AutoFactory don't expect any additional APs besides AutoFactory itself.

cc @ronshapiro

@cgdecker cgdecker added Component: factory P3 type=other Miscellaneous activities not covered by other type= labels labels Aug 1, 2019
@wezley98
Copy link

This is also breaking incremental annotation processing on AutoFactory 1.0-beta7

w: [kapt] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: 
com.google.auto.value.extension.memoized.MemoizedValidator (NON_INCREMENTAL), 
com.google.auto.value.processor.AutoAnnotationProcessor (NON_INCREMENTAL), 
com.google.auto.value.processor.AutoValueBuilderProcessor (NON_INCREMENTAL), 
com.google.auto.value.processor.AutoValueProcessor (NON_INCREMENTAL).

@technoir42
Copy link
Author

I use this workaround for now:

configurations.all {
    resolutionStrategy {
        force "com.google.auto.value:auto-value-annotations:1.6.6"
        eachDependency { details ->
            if (details.requested.group == "com.google.auto.value" && details.requested.name == "auto-value") {
                details.useTarget "com.google.auto.value:auto-value-annotations:1.6.6"
            }
        }
    }
}

@elharo
Copy link
Contributor

elharo commented Oct 9, 2019

#773 is related

@eamonnmcmanus eamonnmcmanus self-assigned this Mar 25, 2021
copybara-service bot pushed a commit that referenced this issue Apr 7, 2021
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: factory P3 type=other Miscellaneous activities not covered by other type= labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants