博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Dependency management (rebar 依赖库配置)
阅读量:6238 次
发布时间:2019-06-22

本文共 2481 字,大约阅读时间需要 8 分钟。

hot3.png

Dependency management

Rebar can fetch and build projects including source code from external sources(git, hg, etc.)

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(递归的).

Defining dependencies


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' specifies the OTP application name, either as an atom or a string
  • 'VsnRegex' is a string containing a regular expression that must match the OTP application version string
  • 'Source' specifies the engine used to fetch the dependency along with an engine specific location :
    • {hg, Url, Rev} Fetch from mercury repository
    • {git , Url} Fetch from git repository
    • {git, Url, {branch, Branch}} Fetch from git repository
    • {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" dependencies

A dependency specification can have an optional fourth element: [raw].

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.

"Raw" dependencies can still contain rebar.config and even can have the proper OTP directory layout, but they won't be compiled.

Only a subset of rebar commands will be executed on the "raw' subdirectories: get-deps, update-deps, check-deps, list-deps and delete-deps.

Example

in 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 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://my.oschina.net/lvhuizhenblog/blog/1925277

你可能感兴趣的文章
cacti 安装配置 错误处理
查看>>
strong,retain,weak,assign自匹配宏
查看>>
烂泥:wiki系统confluence5.6.6安装、中文、破解及迁移
查看>>
BOM展开2
查看>>
Shell基础- 变量、判断、循环
查看>>
九月,我让她别搭理我
查看>>
Oracle 学习之性能优化(八)优化器
查看>>
修改ssh和ssl版本号 升级openssl
查看>>
kubernetes 拉取私有镜像 imagepullsecrets
查看>>
[转]数据交换指定实现无锁堆栈
查看>>
C语言:井字棋盘的实现
查看>>
RabbitMQ消息应答------ack机制
查看>>
我的友情链接
查看>>
IOS中的KVO机制详解
查看>>
关于未捕获异常(Uncaught Exception)的处理
查看>>
Windows2003下面文件夹带权限移动
查看>>
怎么样将自己开发的Android应用程序编译到系统Image中
查看>>
kali 安装完成后,无法进入界面
查看>>
TortoiseSvn问题汇总(持续更新)
查看>>
html5中的锚点特效
查看>>