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