-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Feature request: Support KSP #4492
Comments
"The reduction of build times is only applicable if there are no other processors that use KAPT." Meaning: if you have Glide in your project, KSP won't bring any benefits until Glide support is ready. They told us to exercise social pressure. Here it is :) |
More social pressure! |
Unfortunately the API for KSP is not compatible with the java equivalent. We're going to have to do some non-trivial abstracting, mostly of the methods here: glide/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java Line 57 in a8c24c6
Since Glide is an open source project, anyone is welcome to contribute. The best way to apply social pressure is to of course spend your time on the improvement :) This isn't completely straightforward, so if someone is interested, please reach out to me directly before you get too far so we can talk about it. |
Oh this also appears to be blocked internally due to lack of support where Glide is hosted, so we'll need more work from the KSP team before it's possible to submit anything here. |
what does that mean? |
Any updates on this? |
Happy new year 2022 everyone! |
me2 |
me2 |
me2 |
me2 |
Hi guys, any updates on this? |
hi all,as u know, glide-parent project is a project based on java ,i've released a version of glide ksp jar which using kotlin language and ksp to maven central repository,named |
Glide is blocking us from migrating from KAPT to KSP too |
KSP apparently continues not to be available in the Google repo where Glide lives, which will complicate a migration. We could still accept contributions towards adding a second processor externally. It'll require some coordination, so please let me know if you're interested in working on it. |
I found that Kotlin seems going to abandon KAPT in new K2 compiler: https://youtrack.jetbrains.com/issue/KT-52284 Change Log here: https://github.com/JetBrains/kotlin/releases/tag/v1.7.0-RC2 |
Please be careful what information you spread. KAPT is currently not supported in the experimental K2. It is still on the roadmap for beta. https://youtrack.jetbrains.com/issue/KT-52604/Release-K2-Beta |
Very close? Please, could you share the source of this statement? |
Looks like there is still quite a lot of work to do google/dagger#2349 |
they're at least closer than glide is, glide doesn't even seem to be trying, they just said it's not easy and asked for volunteers to help with it. |
One more vote for this |
Plan for now is to support:
We will not supported Glide's generated API (Extensions, GlideApp, GlideRequests, GlideRequest). We will not support modules registered via AndroidManifests. This will allow people to use KSP to configure Glide and register integration libraries while substantially minimizing the amount of code that needs to be duplicated in the KSP processor. Users that want to use the full generated API can continue to use the Java annotation processor. I'm not sure how many people today use GlideApp/GlideRequests/GlideRequest without an Extension today. We did recommend people do so for a while (and may still) in our documentation. If we don't generate those in KSP, people will have some migration work to do to use KSP. It's pretty trivial because the APIs will be identical, but a large codebase may have to change a lot of callsites to switch from the generated API back to the underlying classes (Glide, RequestManager, RequestBuilder). If a lot of you do this, please let me know here. We could consider trying to generate these classes to ease the migration path while still not supporting Extensions. |
… in that round. When we encounter an AppGlideModule, we read all previously read Index classes, extract the LibraryGlideModules they point to, and write a merged AppGlideModule that calls the developer's AppGlideModule and all of the LibraryGlideModules. Excluding LibraryGlideModules is not supported yet. The library is still in a pre-release state. Progress towards #4492 PiperOrigin-RevId: 460856048
Every round now writes a new Index containing all LibraryGlideModules in that round. When we encounter an AppGlideModule, we read all previously read Index classes, extract the LibraryGlideModules they point to, and write a merged AppGlideModule that calls the developer's AppGlideModule and all of the LibraryGlideModules. Excluding LibraryGlideModules is not supported yet. The library is still in a pre-release state. Progress towards #4492 PiperOrigin-RevId: 460856048
Every round now writes a new Index containing all LibraryGlideModules in that round. When we encounter an AppGlideModule, we read all previously read Index classes, extract the LibraryGlideModules they point to, and write a merged AppGlideModule that calls the developer's AppGlideModule and all of the LibraryGlideModules. Excluding LibraryGlideModules is not supported yet. The library is still in a pre-release state. Progress towards #4492 PiperOrigin-RevId: 460856048
Every round now writes a new Index containing all LibraryGlideModules in that round. When we encounter an AppGlideModule, we read all previously read Index classes, extract the LibraryGlideModules they point to, and write a merged AppGlideModule that calls the developer's AppGlideModule and all of the LibraryGlideModules. Excluding LibraryGlideModules is not supported yet. The library is still in a pre-release state. Progress towards #4492 PiperOrigin-RevId: 461946515
Launched in 4.14.0 (though you'll want 4.14.2+) |
Officially supported as of 4.14 – bumptech/glide#4492
Officially supported as of 4.14 – bumptech/glide#4492
For Kotlin projects, Glide currently makes use of KAPT. This is generally quite slow since it requires generating Java stubs before the annotation processing step.
KSP offers an alternative to this by making it easier for annotation processors like Glide to more directly use Kotlin's compiler plugin infrastructure. Based on initial benchmarks, using KSP can speed up build times by as much as 2x.
The text was updated successfully, but these errors were encountered: