Rebar and generated .erl files

Tim Watson watson.timothy at gmail.com
Mon Feb 6 12:02:45 EST 2012


Not sure how you call protoc-gen-erl but you can do this prior to rebar
compiling your sources by adding either adding to your rebar.config
`{pre_hooks, [{compile, "<GEN_CMD>"}]}` or adding a plugin to your build
which hooks the `pre_compile/2` command API - see
http://hyperthunk.github.com/rebar-plugin-tutorial/ for more details. You
can then put the sources separately by doing this:

{erl_opts, [{src_dirs, ["src", "generated"]}]}.

But of course, rebar already has a protocol buffers compiler:
https://github.com/basho/rebar/blob/master/src/rebar_protobuffs_compiler.erl.
This just looks in the "src" directory for .proto files. I'm not sure what
underlying implementation it uses though.

HTH

On 6 February 2012 16:01, Ransom Richardson <ransomr at cocomo.com> wrote:

>  I'm new to Erlang and Rebar. My project uses protoc-gen-erl (
> http://code.google.com/p/protoc-gen-erl/) to generate .erl files from
> protocol buffer .proto files. I am trying to find a good way to deal with
> these generated files in rebar.
>
>  It seems like the simplest thing to do would be to put the generated
> files in the src directory for my app. But I was wondering if there is a
> way that would better keep the generated files separate from my actual
> sources.
>
>  thanks for any help,
> Ransom
>
> _______________________________________________
> rebar mailing list
> rebar at lists.basho.com
> http://lists.basho.com/mailman/listinfo/rebar_lists.basho.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/rebar_lists.basho.com/attachments/20120206/a6ff6e78/attachment.html>


More information about the rebar mailing list