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

Move the Index annotation for KSP to annotations. #4919

Merged

Conversation

sjudd
Copy link
Collaborator

@sjudd sjudd commented Oct 5, 2022

The processor will produce a Index annotated class for each LibraryGlideModule in given compilation unit. If the Index annotation is in the ksp module, it will not be accessible in parent modules, causing a compilation failure. To work around that, we'll follow the same pattern as we did for Java and place the annotation in the annotations package, but with package private visibility.

Any compilation unit that uses our annotation processor must already have a dependency on annotation, so the Index annotation will be available.

While I've added a test that at least verifies Indexes are generated correctly, unfortunately it doesn't detect the issue with imports. It's still useful to add here because it helps validate that the changes I made actually work.

Fixes #4911.

@sjudd sjudd added import-ready Indicates the PR is ready to be imported to Google. and removed import-ready Indicates the PR is ready to be imported to Google. labels Oct 5, 2022
@sjudd sjudd force-pushed the fix_library_glide_module_deps branch from f29af5c to e59817f Compare October 6, 2022 00:16
The processor will produce a Index annotated class for each LibraryGlideModule in given compilation unit. If the Index annotation is in the ksp module, it will not be accessible in parent modules, causing a compilation failure. To work around that, we'll follow the same pattern as we did for Java and place the annotation in the annotations package, but with package private visibility.

Any compilation unit that uses our annotation processor must already
have a dependency on annotation, so the Index annotation will be
available.

Fixes bumptech#4911.
@sjudd sjudd force-pushed the fix_library_glide_module_deps branch from e59817f to 463688b Compare October 6, 2022 00:22
@copybara-service copybara-service bot merged commit c605b00 into bumptech:master Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-ready Indicates the PR is ready to be imported to Google.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index annotation cannot be resolved on generated code by ksp
1 participant