bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.67k stars 6.12k forks source link

GeneratedAppGlideModuleImpl generated by ksp 'isManifestParsingEnabled' is always false #5414

Open gengzhe opened 5 months ago

gengzhe commented 5 months ago

Glide Version: 4.16.0

Integration libraries: no

Device/Android Version: android 13

Issue details / Repro steps / Use case background: I upgraded kapt to ksp however the 'isManifestParsingEnabled' of the generated class no longer depends on

public boolean isManifestParsingEnabled() {
    return true;
  }

but always returns false.

internal class GeneratedAppGlideModuleImpl(
  @Suppress("UNUSED_PARAMETER")
  context: Context,
) : GeneratedAppGlideModule() {
  private val appGlideModule: MyAppGlideModule
  init {
    appGlideModule = MyGlideModule()
  }

  public override fun registerComponents(
    context: Context,
    glide: Glide,
    registry: Registry,
  ) {
    GlideModule().registerComponents(context, glide, registry)
    glideModule.registerComponents(context, glide, registry)
  }

  public override fun applyOptions(context: Context, builder: GlideBuilder) {
    appGlideModule.applyOptions(context, builder)
  }

// it is always false it not depends on 'appGlideModule' anymore 
  public override fun isManifestParsingEnabled(): Boolean = false
}

Glide load line / GlideModule (if any) / list Adapter code (if any): I am using manifest for parsing glide module, but it doesn't work if i use ksp.

@GlideModule
class MyAppGlideModule : AppGlideModule() {

    override fun isManifestParsingEnabled(): Boolean {
        return true
    }

    override fun registerComponents(
            context: Context, glide: Glide, registry: Registry
    ) {
        registry.register(SVG::class.java, PictureDrawable::class.java, SvgDrawableTranscoder())
                .append(InputStream::class.java, SVG::class.java, SvgDecoder())
    }
}

<meta-data
            android:name="com.XXX.AppGlideModule"
            android:value="GlideModule" />

Layout XML:

Stack trace / LogCat: