Hi, I was experimenting a bit with adding functions to gpb for calculating names of inputs dependencies and resulting outputs. It is currently on a branch in gpb, the makedep branch. I intend to merge it soon. This issue is mostly a heads-up, in case you think it could have use for it in rebar3_gpb_plugin, and if you should find something to add or modify for it to be of more value. Feel free to close this issue at any time.
Here's an annotated example to show how it works::
$ cat m/a2.proto
syntax="proto2";
import "d/dir1/x.proto";
import "d/dir2/x.proto";
message MsgA { required uint32 f1 = 1; }
$ erl
1> gpb_compile:list_io("./m/a2.proto", [{i,"m"}, {o_erl,"src"}, {module_name_suffix, "_pb"}]).
[%% calculated outputs, options for output and renaming are considered:
{erl_output,"src/a2_pb.erl"},
{hrl_output,"./m/a2_pb.hrl"},
%% Inputs, the first one is the main proto, any imports follow:
{sources,["./m/a2.proto","m/d/dir1/x.proto",
"m/d/dir2/x.proto"]},
%% Any imported files that could not be located end up here:
{missing,[]}]
(There are also some command line switches to access this functionality, inspired by the erlc and gcc -M family of options)
Hi, I was experimenting a bit with adding functions to gpb for calculating names of inputs dependencies and resulting outputs. It is currently on a branch in gpb, the
makedep
branch. I intend to merge it soon. This issue is mostly a heads-up, in case you think it could have use for it in rebar3_gpb_plugin, and if you should find something to add or modify for it to be of more value. Feel free to close this issue at any time.Here's an annotated example to show how it works::
(There are also some command line switches to access this functionality, inspired by the erlc and gcc -M family of options)