You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I just have a question about a Kotlin best practices in multi-modular projects.
In the current setup I have multiple sub-modules with its own models annotated with @JsonSerializable and Factories. So each of them have the factory generated in the build directory, Then in the top module which is a lambda function module in my case I create moshi instance and I add all factories from submodules to it.
Is this a right approach?
Will it be possible for Kotshi to automatically gather those factories and create one wrapper factory?
The text was updated successfully, but these errors were encountered:
Unfortunately Kotshi doesn't have support for generating aggregate factories across modules. This mostly stems from a limitation in KSP/KAPT as it can only find annotated classes in a single module. There are ways around this that Hilt uses for example but they aren't ideal here.
I've been considering adding support for Moshi's codegen which would let you skip adding a factory all together but it does require reflection and some proguard rules to be generated.
For now your options are either to create one factory per module like you do now or to switch to Moshi's official codegen.
Hi. I just have a question about a Kotlin best practices in multi-modular projects.
In the current setup I have multiple sub-modules with its own models annotated with @JsonSerializable and Factories. So each of them have the factory generated in the build directory, Then in the top module which is a lambda function module in my case I create moshi instance and I add all factories from submodules to it.
Is this a right approach?
Will it be possible for Kotshi to automatically gather those factories and create one wrapper factory?
The text was updated successfully, but these errors were encountered: