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

Inconsistent Handling of @GlideModule Annotation Between KSP and KAPT #5411

Open
blipinsk opened this issue May 27, 2024 · 0 comments
Open

Comments

@blipinsk
Copy link

blipinsk commented May 27, 2024

There's a difference in the way KSP handles @GlideModule annotation in comparison to KAPT.

  • KSP: the exact class which is annotated with @GlideModule must extend AppGlideModule or LibraryGlideModule
  • KAPT: a parent class of the one annotated with @GlideModule can extend AppGlideModule or LibraryGlideModule

Glide Version: 4.16.0

Issue details / Repro steps / Use case background:

open class BaseGlideAppModule : AppGlideModule() {

    override fun registerComponents(context: Context, glide: Glide, registry: Registry) {
      // ... some common behavior (e.g. reused across build variants of an android app)
    }
}
@GlideModule
class GlideModule : BaseGlideAppModule() {

    override fun registerComponents(
        context: Context,
        glide: Glide,
        registry: Registry,
    ) {
        super.registerComponents(context, glide, registry)
        // ... registering something
    }
}

☝️ this compiles fine when using the compiler with KAPT (kapt("com.github.bumptech.glide:compiler:4.16.0")), but fails when using KSP (ksp("com.github.bumptech.glide:ksp:4.16.0")) with 👇

Stack trace / LogCat:

[ksp] @GlideModule annotated classes must implement AppGlideModule or LibraryGlideModule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant