Tooling to generate bindings for multiple languages

30 views
Skip to first unread message

marko

unread,
Jan 16, 2020, 9:00:18 AM1/16/20
to Protocol Buffers
Hi,

I'm trying out Protocol buffers and would be interested in learning
what kind of tooling more experienced Protobuf users are using
to generate code for multiple languages (Java, Python, C++),
compiling language bindings and publishing the bindings in an artifact repository.

thanks!

marko

Leo Hilbert

unread,
Jan 17, 2020, 4:44:13 AM1/17/20
to Protocol Buffers
Hi, take a look at the "Other Languages"-Section in the protobuf docs. There is also a list of examples.
Basically you can extend protoc with your plugin by writing a binary that reads a CodeGeneratorRequest (protobuf-message) via standard-in and print a CodeGeneratorResponse (also protobuf-message) to standardout.
The CodeGeneratorRequest already has a lot of information interpreted, you "just" need to read it and convert it into code. So you use a language that already has a protobuf-compiler to compile your own protoc-plugin (for extending functionality or compiling your own classes).
Reply all
Reply to author
Forward
0 new messages