erlang rebar 配置mysql_Erlang Rebar 使用指南之四:依赖管理
Erlang Rebar 使用指南之四:依賴管理
全文目錄:
本章鏈接:
1 rebar依賴定義
Rebar取得和構建符合OTP/Rebar規范的項目。如果項目包含子項目,Rebar會自動遞歸地構建它們。
項目的依賴在project_dir/rebar.config中定義,形式如下:
{deps, [Dependency1, Dependency2, ...]}.
其中每一項(Dependency?)都按照{App, VsnRegex, Source, [raw]}定義:
‘App‘ 指定OTP應用名稱,可以是atom或字符串
‘VsnRegex‘ 用于匹配版本號的正則表達式
‘Source‘ 按照下面的格式指定OTP應用的地址:
{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]是可選的。包含[raw]的依賴項不要求安裝Erlang/OTP的項目結構。項目編譯時,該依賴項不會自動被編譯,但是下面的命令對其有作用:
get-deps
update-deps
check-deps
list-deps
delete-deps
2 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]}
]}.
原文:http://blog.csdn.net/ubuntu64fan/article/details/41648263
總結
以上是生活随笔為你收集整理的erlang rebar 配置mysql_Erlang Rebar 使用指南之四:依赖管理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java计算字符串中字符出现的次数_ja
- 下一篇: 如何启动和关闭oracle数据库,Ora