-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 Kotlin Symbol Processing (KSP) #7310
Comments
@mannodermaus Thanks for the input. We are aware that KSP has been promoted to alpha, but have not yet evaluated/looked into replacing the current Realm annotation processor for Kotlin with it. |
Just FYI, KSP is now stable!👀 https://android-developers.googleblog.com/2021/09/accelerated-kotlin-build-times-with.html |
FWIW I was trying to help out here and look into a potential migration to KSP as an external contribution, but frankly I was unable to get Realm compiled on my machine. 🙈 Is there a rough roadmap or guidance of Realm regarding this feature? |
The Realm Kotlin SDK exists now. Is it safe to assume that KSP wouldn't be added for the older Java SDK, esp. since the new one seems to be built as a compiler plugin instead? |
Yes, we do not have any immediate plans to rewrite the code generation parts of realm-java with KSP. KSP would only work for Kotlin code and doesn't support transforming existing code, so wouldn't suffice for our full use case. This is also why we use compiler plugins in realm-kotlin. |
Heyoooo <3 any updates on this front? Just curious as we are moving our entire project over to ksp and the last bit is the realm of it all. Just for reference, i changed our module containing realm into ksp and got this error, after searching on the net i found that the underlying generation uses kapt, which led me here :)
For now the android docs say kapt and ksp can run in parralel together so ill add kapt plugin back to this module and keep an eye on this issue <3 Thank you all btw for your amazing work on realm, just needed to be said <3 |
I'd like to add my voice to asking for updates on this. We are also trying to move our project completely over from |
As always, the only thing that slows down our project from innovation is the realm :( |
Any update on this? |
Since the release of Kotlin 2.0, the importance of migration to KSP increases due to:
|
We don't have plans to add new features to realm-java and instead recommend that you migrate to our native kotlin SDK: https://github.com/realm/realm-kotlin. |
This is absurd. |
@EranBoudjnah We have a migration guide that should give you an overview of the differences. It is hard to give a step-by-step guide on the actual process as it depends on your use case. Feel free to provide feedback on what items you are missing with regards of migrations and/or what you are missing from the realm-kotlin documentation. |
Thanks @rorbech - this helps. Let me dig into it, and I'll keep track of anything that I'm missing as I'm going through the migration. One obvious thing is that the README on the repo https://github.com/realm/realm-kotlin disagrees with the rest of the documentation (for example, |
|
From the API docs for this method:
Regarding the equality operator, the fact Finally, the realm-kotlin readme does link to the install instructions in the installation section. The docs on mongodb.com/docs should be viewed as the authoritative source of truth and the readme is a compressed and maintainer-focused version of those docs. |
I still think it would be helpful if the documentation was consistent in its use of either It's good to know that the link is the authoritative source of truth, although it seems somewhat outdated (it uses version In any case, thanks for the patience and help, @nirinchev! |
Can you try |
Nice! This works. |
Describe your problem or use case
Kotlin Symbol Processing (KSP) is a joint effort by Google & JetBrains and seeks to provide an API for building compiler plugins. Compared to KAPT, annotation processors that use KSP can run up to 2x faster.
Describe the solution you'd like
Introduce a sibling artifact to the
realm-annotations-processor
which leverages the performance and benefits of KSP over KAPT for Kotlin-based projects.The text was updated successfully, but these errors were encountered: