-
Notifications
You must be signed in to change notification settings - Fork 51
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: Room KSP support #238
Comments
Thanks for the request Phil. |
I could put together a standalone repro, but I think the issues are exactly the same as they are for the kapt version - |
That helps for now. Thanks. |
@PhilGlass do you know if there is an issue tracking the KSP cache miss on Google's side? |
I don't know of a KSP specific one - I guess the existing issue applies? In that you can't really fix this using only kapt/KSP APIs, you need a Gradle plugin. |
Can you please add a comment in that one or file a new one? :) |
This is currently not possible since KSP does not expose a way to pass |
One thing to note is that, like kapt, KSP tasks wipe any declared output directories when they run non-incrementally (this behaviour is inherited from |
Thanks for following up on this @PhilGlass . Unfortunately, On the second note thanks for sharing, that is why the workaround that google has explained here is simply not sufficient. Please comment and let Google know that their workaround is not sufficient. I have already shared my thoughts with them on this workaround via other channels but I would like to hear the community say it as well. The Android Cache Fix plugin has a workaround for the task outputs being cleared . |
It's definitely not a workaround on its own - but it is a mechanism you can use to pass arguments to KSP without them becoming a task input (using
Done. As I mentioned in that comment, Auto migrations are another spanner in the works. Now the schemas directory is both an input and output of the kapt/KSP tasks, because past versions of the schema are required to generate the auto migrations. So if the schema directory changes, Room should re-run... but Room also writes the current schemas into that directory, effectively invalidating its own inputs for the next build. 😭 |
Thanks for commenting there! Makes sense that the Subplugin options are a workaround. I'll take care of resolving your comments in the PR soon. And yes the RoomSchemaWorkaround does also take care of the pre-existing schemas. |
I can't edit it any more - but it already mentions kapt briefly.
Sort of. It copies the contents of the version controlled schemas directory to the temporary directories passed as |
Thanks for that edge case. It's a good point that we don't cover that, we didn't think it was so common. Is that a common thing to delete old schema? |
I don't think so - I haven't seen this fail in practice. Just another thing that came to mind when I was thinking about all the things that are wrong with the way |
Seeing as the PR has been merged in KSP, is there any news on this topic ? |
Unfortunately, this is still blocked by this. KSP requires variant support in order for this workaround to work otherwise we will have overlapping outputs and the caching will still be disabled. |
@PhilGlass @PhilGlass we have published version 2.7.0 with support for ksp in the RoomWorkaround |
KSP has been stable for a while now, and is supported by Room since 2.3.0-beta02.
The schema generation behaviour is the same as the kapt version, so it suffers from the same cache miss issues.
The text was updated successfully, but these errors were encountered: