[Note: this plugin is now developed alongside the library in the pb repository.]
A protoc
plugin that turns .proto
files into OCaml protobuf serialization functions built with the pb
library.
protoc --plugin=protoc-gen-custom=$(type -p pb_plugin) --custom_out=./build file.proto
The interface between protoc
and plugins is defined as a set of protobuf messages that describe the contents of a .proto
file.
The pb-plugin
plugin is bootstrapped. The file src/protoc_messages.ml
that reads and writes messages passed between protoc
and the plugin
is generated from the file misc/messages_unnested.proto
using pb-plugin
itself