Meaning of elements in Rebar deps configuration
Asked Answered
T

1

6

We're using rebar to pull dependencies for our project, many of them from github. Our config looks something like:

{deps, [
        {cowboy, "", {git, "git://github.com/extend/cowboy.git", {branch, "master"}}}
       ]}.

I understand enough to get by, and I've learned a couple things by trial and error (for example, how to specify tags and changesets rather than branches), but my google-fu is unable to find any sort of comprehensive documentation on what options are available or what they do.

I'm specifically wondering about the purpose of the second value is (often empty string, but I occasionally see version numbers and wildcards in it), but more info about source control options, or just documentation in general would be helpful.

Tenstrike answered 20/4, 2012 at 19:42 Comment(0)
U
8

You can find the full documentation of rebar here:

https://github.com/rebar/rebar/wiki

A detailed rebar.config sample, showing most of the available options is available at:

https://github.com/rebar/rebar/blob/master/rebar.config.sample

Reading from the deps section:

%% What dependencies we have, dependencies can be of 3 forms, an application
%% name as an atom, eg. mochiweb, a name and a version (from the .app file), or
%% an application name, a version and the SCM details on how to fetch it (SCM
%% type, location and revision). Rebar currently supports git, hg, bzr and svn.
{deps, [application_name,
        {application_name, "1.0.*"},
        {application_name, "1.0.*",
         {git, "git://github.com/basho/rebar.git", {branch, "master"}}},
        {application_name, "1.0.*",
         {git, "git://github.com/basho/rebar.git", {branch, "master"}},
         [{alt_url, "https://github.com/basho/rebar.git"}]}]}.

As you can see, the specific parameter you've pointed out relates to the version of the Erlang application (intended as an OTP application). Versions are indicated in the Erlang Application files.

Uraeus answered 20/4, 2012 at 21:15 Comment(1)
I had looked at the wiki but didn't find much about deps. I hadn't come across the rebar.config.sample though. Thanks.Tenstrike

© 2022 - 2024 — McMap. All rights reserved.