These are chat archives for trueaccord/ScalaPB

7th
Jun 2018
Dominic Bou-Samra
@dbousamra
Jun 07 09:42
is there any way to prefix all the generate types with something like GRPC* ?
Nadav Samet
@thesamet
Jun 07 15:02
@dbousamra , not automatically for all of them, but you can manually set the Scala name for messages to be whatever you want by adding an option
Alexander Shniperson
@AlexanderShniperson
Jun 07 15:16
is there full example of how to use custom code generation? looks like here is lost source https://github.com/thesamet/sbt-protoc/tree/master/examples/custom-gen
Andrea Peruffo
@andreaTP
Jun 07 16:05
@thesamet probably faster to discuss here :-)
thanks for the guidance first!

regarding:

I wonder if the new generator and runtime functions can be shipped in a separate library (even if it's hosted in this repo)?

in the past I did it like this:
https://github.com/unicredit/sbt-swagger-codegen/blob/master/plugin/src/main/scala/eu/unicredit/swagger/SwaggerCodegenPlugin.scala#L48

basically giving the user the possibility to set what generator to use: https://github.com/unicredit/sbt-swagger-codegen-examples/blob/extending/build.sbt#L22

does this apply somehow also to ScalaPB?

Nadav Samet
@thesamet
Jun 07 16:40
@AlexanderShniperson that source you linked to can help you get started. There's also a UDT generator in sparksql-scalapb you can look at. I don't think there's anything better, but feel free to ask questions here.
@andreaTP Exactly, if you create a new generator, a user can just add it to their PB.targets and have it generate their code
Andrea Peruffo
@andreaTP
Jun 07 16:53
ok, I will go for it, it will break compatibility though ... I guess
(it will take time to get to a full implementation tough ... I'm doing it in spare time)
Nadav Samet
@thesamet
Jun 07 18:18
@andreaTP why would it break compatibility if it's a separate generator? In what way?