Dependency managementgit
Rebar can fetch and build projects including source code from external sources(git, hg, etc.)github
It is assumed that these dependencies are available in source form and adhere to the rebar conventions. Moreover, if a project's dependencies have their own dependencies, rabar fetches and builds these transitive dependencies recursively(遞歸的).web
Defining dependenciesexpress
Dependencies are defined in the rebar.config file by the adding the deps tuple of the following form: {deps, [Dependency1, Dependency2, ...]}.
Each dependency is defined by a triplet {App, VsnRegex, Source} where:app
A dependency specification can have an optional fourth element: [raw].fetch
Such dependencies are called "raw' and rebar does not require them to have a standard Erlang/OTP layout which assumes the presence of either src/dependency_name.app.src or ebin/dependency_name.app files.ui
"Raw" dependencies can still contain rebar.config and even can have the proper OTP directory layout, but they won't be compiled.atom
Only a subset of rebar commands will be executed on the "raw' subdirectories: get-deps, update-deps, check-deps, list-deps and delete-deps.code
in rebar.configorm
{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 has only the master branch % {mochiweb, "2.3.2", {git, "https://github.com/mochi/mochiweb.git", "15bc558d8222b011e2588efbd86c01d68ad73e60"}, % An example of a "raw" dependency: {rebar, ".*", {git, "git://github.com/rebar/rebar.git", {branch, "master"}}, [raw]} ]}.
原文連接: https://github.com/rebar/rebar/wiki/Dependency-management