Rebar3 proto plugin
A rebar plugin for generating module proto_info, which provides frequently-used functions when using gpb flow.
This plugin cooperates with rebar3_gpb_plugin, Configure it first.
Build
$ rebar3 compileUse
Add the plugin to your rebar config:
{project_plugins, [
{rebar3_gpb_plugin, "2.22.1"},
{rebar3_proto_plugin, "0.1.7"}
]}.
Config the proto_opts and provider_hooks:
{proto_opts, [
{o_meta_file, "proto_info.meta"},
{o_proto_info, "src/proto_info.erl"},
{custom_info, ["src/proto_info_custom.erl"]}
]}.
{provider_hooks, [
{pre, [
{compile, {protobuf, compile}},
{compile, {proto, generate}},
{clean, {protobuf, clean}}
]},
{post, [
]
}
]}.Example
A simple example locate in doc/example_app.
proto_info.meta and src/pb/proto_info.erl are generated by current plugin.