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

Support for KSP #105

Open
RicardoJiang opened this issue Dec 4, 2022 · 9 comments
Open

Support for KSP #105

RicardoJiang opened this issue Dec 4, 2022 · 9 comments

Comments

@RicardoJiang
Copy link

RicardoJiang commented Dec 4, 2022

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 RicardoJiang changed the title Support KSP Support for KSP Dec 4, 2022
@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Mar 4, 2023

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...

@zjupure
Copy link
Owner

zjupure commented Jul 16, 2023

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

@ArtRoman
Copy link

ArtRoman commented Sep 16, 2023

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"

@AndroidDeveloperLB
Copy link

@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?

@ArtRoman
Copy link

@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.

@AndroidDeveloperLB
Copy link

@ArtRoman OK thank you!

@ArtRoman
Copy link

@AndroidDeveloperLB you can close issue if all is OK

@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Sep 17, 2023

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

@ArtRoman
Copy link

But please update the repository guidelines.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants