Skip to content

Consider using compileOnlyApi over implementation for compile-time annotations #156

@yuri-sergiichuk

Description

@yuri-sergiichuk

The new compileOnlyApi dependency introduced in Gradle v6.7 allows using the new scope for dependencies that must be present while compiling the code, but not required in runtime.

Also, the api part exposes the dependency of the library to the consumers, so they are e.g. able to rely on the same annotations while running their annotation processors with the library.
An example of a dependency that'll benefit from the new scope is ErrorProne annotations. The annotations are required during the compile-time and give hints to other users about the library behavior but are not really used in runtime.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions