Erlang Rebar Use Guide IV: Dependency Management

Source: Internet
Author: User

Erlang Rebar Use Guide IV: Dependency Management

Full-Text Catalogs:

Https://github.com/rebar/rebar/wiki

This chapter Links:

Https://github.com/rebar/rebar/wiki/Dependency-management

1 Rebar Dependency Definitions

Rebar obtains and constructs projects that conform to the Otp/rebar specification. If the project contains sub-projects, rebar will automatically build them recursively.

The dependencies of the project are defined in Project_dir/rebar.config, in the following form:

{deps, [Dependency1, Dependency2, ...]}.

Each of these items (Dependency?) All follow the { App, VsnRegex, Source, [raw]Custom

    • ' app ' specifies the OTP app name, which can be atom or string
    • ' Vsnregex ' is used to match the regular expression of the version number
    • ' Source ' Specifies the address of the OTP application in the following format:

    {HG, Url, Rev} Fetch from Mercury repository    {git, url} fetch from Git repository    {git, url, {branch, branch}} Fetch from Git rep  Ository    {git, url, "} = = {git, url, {branch," HEAD "}} Fetch from Git repository    {git, url, {tag, tag}} Fetch from Git repository    {git, url, rev} Fetch from Git repository    {bzr, URL, rev.} Fetch from a bazaar repository

[raw]is optional. dependencies that contain [raw] do not require the installation of the ERLANG/OTP project structure. When the project compiles, the dependency is not automatically compiled, but the following command is useful:

Get-depsupdate-depscheck-depslist-depsdelete-deps

2 Examples of Rebar.config

{Deps, [    {em, ". *", {git, "Https://github.com/sheyll/erlymock.git"}},    {nano_trace, ". *", {git, "https:// Github.com/sheyll/nano_trace.git ", {branch," Feature/rebar-migration "}},    {mochiweb," 2.3.2 ", {git," https://  Github.com/mochi/mochiweb.git ", {tag," v2.3.2 "}},    % Or Specify a revision to refer a particular commit, useful if the Project have only the master branch    % {mochiweb, "2.3.2", {git, "https://github.com/mochi/mochiweb.git", "15bc558d822 2b011e2588efbd86c01d68ad73e60 "},    % An example of a" raw "dependency:    {rebar,". * ", {git," git://github.com/ Rebar/rebar.git ", {branch," Master "}}, [Raw]}   ]}.


Erlang Rebar Use Guide IV: Dependency Management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.