Hi! Two months ago I already announced my development of a Gradle Plugin that brings gRPC to Kotlin Multiplatform. I have finally added iOS support. Therefore, it now allows you to make client-side calls from multiplatform code to Android, iOS, JVM and JS targets, as such allowing you to share your network logic.
Once again, I would greatly appreciate any feedback on the project!
https://github.com/TimOrtel/GRPC-Kotlin-Multiplatform
p
Paul Woitaschek
08/21/2022, 8:22 PM
Do I understand correctly, that it generates a DSL for the messages? If so, why not simply a data class?
t
Tim Ortel
08/21/2022, 8:55 PM
I wanted to make the library look and feel exactly like the one offered for Kotlin/JVM.
Tim Ortel
08/21/2022, 9:00 PM
Right now, for JVM the plugin does not generate the logic itself, but delegates it the files generated by protoc. Therefore, a data class is not possible. However, I am planning on generating the proto logic for JVM myself. Then data classes may be a viable option.
p
Paul Woitaschek
08/22/2022, 6:55 AM
I think in that case I'd rather generate a function that mandates all fields. I always find it very strange if there is a dsl in Kotlin for creating objects. Usually, named arguments are just so much better and compile time safe