Pergunta

I have a number of applications that need a header file to be generated before compilation. This seemed to be a perfect candidate for a Rebar plugin, so I created a plugin with a pre_compile function, put it in a Git repository, and listed it as a dependency in rebar.config in the other applications.

However, the plugin must be compiled before it can be loaded, so when I run rebar compile -v I find that rebar complains about not finding the plugin, then compiles the dependency, and then fails to compile my application because the header file has not been generated.

Is there a way to accomplish what I'm trying to achieve with a Rebar plugin, or do I need to find another way to do it?

Foi útil?

Solução

The plugin_dir option is your friend:

{plugin_dir, "deps/my_plugin/src"}.

That makes Rebar try to compile the plugin from that source directory if it can't find it in the code path already.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top