Packages
rebar3_gpb_plugin
1.2.0
3.0.1
3.0.0
2.23.8
2.23.7
2.23.6
2.23.5
2.23.4
2.23.3
2.23.2
2.23.1
2.23.0
2.22.7
2.22.6
2.22.5
2.22.4
2.22.3
2.22.2
2.22.1
2.22.0
2.21.0
2.20.3
2.20.2
2.20.1
2.20.0
2.19.1
2.19.0
2.18.1
2.18.0
2.17.2
2.17.1
2.17.0
2.16.1
2.16.0
2.15.0
2.14.0
2.13.2
2.13.1
2.13.0
2.12.5
2.12.4
2.12.3
2.12.2
2.12.1
2.12.0
2.11.3
2.11.2
2.11.1
2.11.0
2.10.0
2.9.0
2.8.2
2.8.0
2.7.0
2.6.1
2.6.0
2.5.1
2.5.0
2.4.3
2.4.2
2.4.1
2.4.0
2.3.4
2.3.3
2.3.2
2.3.1
2.3.0
2.2.10
2.2.9
2.2.8
2.2.7
2.2.6
2.2.5
2.2.4
2.2.3
2.2.2
2.2.1
2.2.0
2.1.1
2.1.0
2.0.1
2.0.0
1.12.1
1.12.0
1.11.8
1.11.7
1.11.6
1.11.5
1.11.4
1.11.3
1.11.2
1.11.1
1.11.0
1.10.4
1.10.3
1.10.2
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.2
1.8.1
1.8.0
1.7.3
1.7.2
1.7.1
1.7.0
1.6.1
1.6.0
1.5.2
1.5.1
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.1
1.2.0
1.0.1
A rebar3 gpb plugin for compiling .proto files
Current section
Files
Jump to
Current section
Files
rebar3_gpb_plugin
README.md
README.md
Rebar3 gpb plugin
=====
[](https://travis-ci.org/lrascao/rebar3_gpb_plugin)
A rebar3 plugin for automatically compiling .proto files using the gpb protobuf compiler
Build
-----
$ rebar3 compile
Use
---
Add the plugin to your rebar config:
{plugins, [
{ rebar3_gpb_plugin, "1.2.0" }
]}.
Configure gpb options (example below), full list can consulted on [gpb's project page](https://github.com/tomas-abrahamsson/gpb) [gpb_compile:file/2](https://github.com/tomas-abrahamsson/gpb/blob/3.19.0/src/gpb_compile.erl#L66-L93):
{gpb_opts, [
{i, "path/to/proto_dir"},
{module_name_suffix, "_pb"},
{o_erl, "path/to/out_src"},
{o_hrl, "path/to/out_include"},
{strings_as_binaries, true},
type_specs]}.
The `o_erl` and `o_hrl` values are relative to the app's location.
Add a hook to automatically generate modules for your protobuf files and clean them afterwards:
{provider_hooks, [
{pre, [
{compile, {protobuf, compile}}
{clean, {protobuf, clean}}
]}
]}.