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

Recommend declaring annotations as api #296

Closed
vlsi opened this issue Oct 4, 2020 · 2 comments · Fixed by #324
Closed

Recommend declaring annotations as api #296

vlsi opened this issue Oct 4, 2020 · 2 comments · Fixed by #324
Labels
bug Something isn't working
Milestone

Comments

@vlsi
Copy link
Contributor

vlsi commented Oct 4, 2020

Currently, dependency-analysis-android-gradle-plugin recommends downgrading org.apiguardian:apiguardian-api from api to implementation for Apache Calcite, however, that dependency should always be on the compile classpath.

Just in case, apiguardian-api is a single-annotation dependency: https://github.com/apiguardian-team/apiguardian

Here's a case by JUnit5 jhttps://github.com/junit-team/junit5/issues/1105
Similar case by Guava google/guava#2824
Caffeine ben-manes/caffeine#300

As far as I understand, many compilers need annotation classes for proper compilation (e.g. Error Prone compiler needs annotation definition for proper verification), so projects like Guava, JUnit5, Caffeine settled on using <scope>compile</scope> for their annotations.

It looks like dependency-analysis-android-gradle-plugin should suggest upgrading annotation dependencies to api in case they are used in public-like methods/classes.

@autonomousapps
Copy link
Owner

I read through the junit discussion and it was very interesting -- thanks for linking. Have you tried to follow the (perhaps inaccurate) advice and downgrade apiguardian to implementation? And if so, what was the result? Did you see issues similar in nature to what the junit team discussed?

@autonomousapps
Copy link
Owner

I have a PR now resolving this issue. Annotations on public types will now be considered part of the ABI.

@autonomousapps autonomousapps added this to the 1.0 milestone Nov 21, 2020
@autonomousapps autonomousapps added bug Something isn't working and removed more information needed labels Nov 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants