-
Notifications
You must be signed in to change notification settings - Fork 305
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 KSP (Kotlin Symbol Processing) #1075
Comments
Thanks for reporting! Funny enough, I stumbled upon the note regarding KSP while looking up some Kapt info and created an internal issue for this. From a first look the main issue is that ObjectBox supports plain Java projects, so we likely would have to maintain two annotation processors. |
@greenrobot-team Since that does seem like a big issue, I've done some research on it. |
@natanfudge Thanks for providing all the useful information here. ❤️ Could you also indicate some rough numbers on your project's size, so we can relate the build time to it? |
greenrobot It is a new project, so quite small. ~15 Kotlin files with an average of around 100 LOC. |
The current android jetpack platform actively embraces kotlin, kotlin has a more positive attitude towards ksp, and many android libraries are compatible with ksp, so ObjectBox supporting ksp is a very correct decision |
@greenrobot-team with kotlin 2 kapt slow down too much the compilation time, can prioritize the switch from kapt to ksp, now as workaround i added objectbox classes as a gradle submodule so the compilation is fast because kapt should process only few small files |
Any update about this feature? If is it in progress or any stimated release date or version? |
We'll share updates once there are some. In the meantime, it helps us more if you thumbs up the first post (GitHub can sort issues by thumbs ups)! |
Currently ObjectBox supports using KAPT for processing annotations in Kotlin.
KSP is a new Kotlin annotation processing framework by Google and supported by Jetbrains that processes annotations in a far more 'native' way than KAPT, resulting in improved performance and an API more suited for Kotlin. Consequently, KAPT has lost its focus from the Kotlin team (source).
ObjectBox should seriously consider providing an implementation for processing annotations in Kotlin using KSP. For reference, see this recent build time analysis:
A whopping 75.8% (24.2 seconds) of build time is spent on generating KAPT stubs, which supposedly KSP avoids completely. On the other hand, it appears only 0.8 seconds is spent doing actual Objectbox work.
Further reading:
What is KSP?
Why KSP?
KSP Github
The text was updated successfully, but these errors were encountered: