The version of zio-grpc needs to be compatible with the version of ScalaPB in order to avoid unintended evictions and ensure binary compatibility:
If you are building with sbt, add the following to your
Then, add the following lines to your
This configuration will set up the ScalaPB code generator alongside the ZIO gRPC code generator.
Upon compilation, the source generator will process all proto files under
The ScalaPB generator will generate case classes for all messages as well as methods to serialize and deserialize those messages. The ZIO gRPC code generator will generate code as described in the generated code section.
If you are using ScalaPBC to generate Scala code from the CLI, you can invoke the zio code generator like this:
You will need to add to your project the following libraries: