I've got some protocol buffers definitions, in proto/*.proto
. My current Makefile-based build system compiles each of them into an Erlang module and header, and into a self-descriptor (as a .pb
file) and then embeds the descriptor as a BEAM module:
foo.proto -> foo_pb.erl, foo_pb.hrl
-> foo.pb -> foo_pb_desc.beam
I've implemented a mix_protobuffs
task to do the first step, and the foo.proto -> foo.pb
part-step.
I've also got the relevant code for embedding an arbitrary file into an Erlang module -- inspired by this answer -- but I'm wondering about the recommended way of integrating it into my mix-based build process.
Similarly, I've got some other files that need to be processed and then embedded, which suggests that I shouldn't make the mix_protobuffs
task know about embedding.
So I guess I'm asking: is there a way to have mix run arbitrary commands pre/post another task?