-
Notifications
You must be signed in to change notification settings - Fork 120
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 Gradle configuration cache #311
Comments
same problem here
|
Any info on when this will be fixed? I'd really like to use this in my current project. |
@Alex009 I would like to help (I have some experience with configuration cache), but I have zero knowledge about gradle plugins themselves. Can you help me with setting up local project so I can test it out? |
@lepicekmichal its good. Yes, I will help. |
Any updates on it? |
if moko-resource can support gradle caching it would be great, It can greatly accelerate app development. |
Any update? |
@lepicekmichal is there any way to disable cache configuration for moko-resource? |
I have the same issue when I enable caching but with different error
|
@kazemcodes sorry, we dropped it. So much work that we decided not to use moko-resources. It clearly hasn't been developed with conf cache in mind and doubt it ever will be. As for disabling it, I'm not sure what you mean. Conf cache is a global thing and either all plugins support it or not, ergo you have it or not. |
What alternative do you choose instead of moko-resource |
There is no real alternative sadly. We made our own translation object in the code and the rest of resources are still in progress |
there is new error for me
|
Seems that it's need to fully rewrite resources generator plugin to support configuration cache by removing all references to non-serializable objects in moko resources tasks. It won't be easy walk |
Wouldn't it be sufficient for a temporary workaround to mark all moko-resources tasks as notCompatibleWithConfigurationCache("needs to be rewritten to remove all references to non-serializable objects... See moko-resources#311")? This would allow library consumers to enable config cache, which is no longer unstable and will soon be default. Then they can benefit from the config cache for all other tasks without having their builds broken. https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:task_opt_out |
@colintheshots moko resources tasks run with assemble and so on, it would be the same as disabling the configuration cache. |
@JavierSegoviaCordoba So we'd prefer failing the build rather than disabling the configuration cache temporarily while fixing this? If so, it would be better to explicitly call out the issue in a throw block rather than making developers Google this. |
it would be easier for the developer to understand the crash than they see how they lose the config cache on every run? I am not sure if it is so hard to do a workaround to fix this by just injecting the properties from outside by extracting the code which is used inside the task to a provider outside the task, in a non-clean way (just copy-pasting + wrap in provider). |
I'll take a look at this option. |
I started looking into this over the weekend. This didn't appear to be a quick improvement. We're only expecting about a 13 second build speed improvement by fixing this at our company. I'm not sure the time spent is justified for us. |
Where did things land with this? This is the one issue that's stopping us from using the configuration cache.
I'm not sure that this is the correct way to think about it. This is providing a significantly faster Gradle daemon startup time, is massive improvement to the dev experience. Currently, in our ~150 module Gradle project, moko resources seems to be the one thing blocking us from turning on the configuration cache. |
@Alex009 Is this something that's planned? |
fix in #575 |
will be fixed in 0.24.0, please check in 0.24.0-alpha-6 |
fixed in 0.24.0-beta-1 |
It's not possible to enable Gradle configuration Cache in projects using
moko-resources
For example in the demo project, update the root
gradle.properties
file:Then running
./gradlew :sample:android-app:assembleDebug
You will see many errors:
It looks like this happens because there are tasks in the project that reference several of the types that are disallowed by gradle configuration cache. See disallowed types
The text was updated successfully, but these errors were encountered: