Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of elements in Rebar deps configuration

Tags:

erlang

rebar

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.

like image 770
AwesomeTown Avatar asked Apr 20 '12 19:04

AwesomeTown


People also ask

Where is rebar config?

the rebar. config file at the application root. each top-level app's (in apps/ or libs/ ) rebar.

What is rebar lock file?

The lock file contains information regarding code dependencies, including immutable references for source dependencies like those in git or hg, and their versions along with expected hashes for packages.

What is rebar Erlang?

rebar is an Erlang build tool that makes it easy to compile and test Erlang applications, port drivers and releases. rebar is a self-contained Erlang script, so it's easy to distribute or even embed directly in a project.


1 Answers

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.

like image 194
Roberto Aloi Avatar answered Oct 10 '22 19:10

Roberto Aloi