[erlang-questions] customizing the rebar-generated .app file

Tim Watson <>
Thu Oct 6 09:02:42 CEST 2011


On 5 October 2011 15:29, Joel Reymont <> wrote:

> rebar is being too clever here.
>
> Suppose you are using git and are in the top level of the project when
> building, as you should be.
>
> rebar will default the version to "git describe --always --tags `git log -n
> 1 --pretty=format:%h .`".
>
>
So at the moment if you do {vsn, git} that is what rebar will do. As an
alternative, it would be nice if rebar would allow {vsn, {scm, CmdString}}
so you can customise this. *BUT*...

Rebar already has a few ways to customise what's happening. There are
plugins written in Erlang, which can hook into any command and run either
before, during or after the command is executed, or can add completely new
commands. There are also shell hooks that can run before or after any known
command. I suspect there is a need for the maintainers to keep the number of
extensibility points/hooks to a minimum in order to remain sane.

Nevertheless, I've patched rebar to support this syntax here:
https://github.com/hyperthunk/rebar/tree/custom-vsn-commands - I might make
a pull request of it but let's see what people think first as it might not
be the best approach. You would use it like so:

{application, doodah,
 [
  {vsn, {scm, "git rev-parse --short HEAD"}}]}.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111006/da2f8fd6/attachment.html>


More information about the erlang-questions mailing list