GlideWebpDecoder icon indicating copy to clipboard operation
GlideWebpDecoder copied to clipboard

Support for KSP

Open RicardoJiang opened this issue 2 years ago • 9 comments

Glide 4.14.2 already supports ksp, could you please add support for KSP too? it's faster than kapt, thank you very much

RicardoJiang avatar Dec 04 '22 14:12 RicardoJiang

Can you please also explain what changes will we need to perform? Or maybe it's possible already, at least partially? The IDE claims this for the Glide part:

This library supports using KSP instead of kapt, which greatly improves performance. Learn more: https://developer.android.com/studio/build/migrate-to-ksp

Maybe possible at least partially, then? I tried now, and I got errors while trying to do it. Not sure if it's because I did something wrong, or because it's not possible yet if I use Glide together with this repository...

AndroidDeveloperLB avatar Mar 04 '23 11:03 AndroidDeveloperLB

PR is welcome. I has no more time to migrate kapt to KSP, it is low priority.

zjupure avatar Jul 16 '23 14:07 zjupure

I'm using this library with KSP, all is working good. Just make sure to have a class that extends AppGlideModule and marked with @GlideModule attribute. So auto-generated ksp module GeneratedAppGlideModuleImpl has WebpGlideLibraryModule registered in it:

  public override fun registerComponents(
    context: Context,
    glide: Glide,
    registry: Registry,
  ): Unit {
    WebpGlideLibraryModule().registerComponents(context, glide, registry)  <— Here
    appGlideModule.registerComponents(context, glide, registry)
  }

build.gradle:

    implementation "com.github.bumptech.glide:glide:4.16.0"
    implementation "com.github.zjupure:webpdecoder:2.3.4.15.1"
    //kapt "com.github.bumptech.glide:compiler:4.16.0"
    ksp "com.github.bumptech.glide:ksp:4.16.0"

ArtRoman avatar Sep 16 '23 14:09 ArtRoman

@ArtRoman It says that you should use :

implementation "com.github.bumptech.glide:glide:${GLIDE_VERSION}"

And you have 4.15.1 instead of 4.16.0.

How come?

AndroidDeveloperLB avatar Sep 16 '23 14:09 AndroidDeveloperLB

@AndroidDeveloperLB

Llatest release of Glide is 4.16.0, but GlideWebpDecoder is not updated to this version, so I use Glide as usual with latest build, but for GlideWebpDecoder I must use old full version. They are working good together.

My build.gradle now:

def glide_version = '4.16.0'

dependencies {
    …

    // Glide for images loading
    implementation "com.github.bumptech.glide:glide:$glide_version"
    implementation "com.github.zjupure:webpdecoder:2.3.4.15.1" //TODO use $glide_version after library update
    //kapt "com.github.bumptech.glide:compiler:$glide_version"
    ksp "com.github.bumptech.glide:ksp:$glide_version"
}

You can use 4.15.1 for both libraries, KSP support was added to Glide in 4.14.0.

ArtRoman avatar Sep 16 '23 16:09 ArtRoman

@ArtRoman OK thank you!

AndroidDeveloperLB avatar Sep 16 '23 16:09 AndroidDeveloperLB

@AndroidDeveloperLB you can close issue if all is OK

ArtRoman avatar Sep 17 '23 16:09 ArtRoman

@ArtRoman I'm not the admin of this repository, and not the creator of this thread. But please update the repository guidelines.

AndroidDeveloperLB avatar Sep 17 '23 17:09 AndroidDeveloperLB

But please update the repository guidelines.

And I'm not connected to this repo, too 😀

ArtRoman avatar Sep 18 '23 20:09 ArtRoman