钢筋配置中元素的含义

时间:2012-04-20 19:42:15

标签: erlang rebar

我们正在使用rebar为我们的项目提取依赖项,其中许多来自github。我们的配置类似于:

{deps, [
        {cowboy, "", {git, "git://github.com/extend/cowboy.git", {branch, "master"}}}
       ]}.

我理解得足够了,我通过反复试验了解了一些事情(例如,如何指定标签和变更集而不是分支),但我的google-fu无法找到任何综合关于可用选项或它们的作用的文档。

我特别想知道第二个值的目的是(通常是空字符串,但我偶尔会看到版本号和通配符),但有关源控制选项的更多信息,或者只是文档一般会有所帮助。

1 个答案:

答案 0 :(得分:7)

您可以在此处找到钢筋的完整文档:

https://github.com/basho/rebar/wiki

详细的rebar.config示例显示了大多数可用选项,可在以下位置找到:

https://github.com/basho/rebar/blob/master/rebar.config.sample

deps 部分阅读:

%% What dependencies we have, dependencies can be of 3 forms, an application
%% name as an atom, eg. mochiweb, a name and a version (from the .app file), or
%% an application name, a version and the SCM details on how to fetch it (SCM
%% type, location and revision). Rebar currently supports git, hg, bzr and svn.
{deps, [application_name,
        {application_name, "1.0.*"},
        {application_name, "1.0.*",
         {git, "git://github.com/basho/rebar.git", {branch, "master"}}},
        {application_name, "1.0.*",
         {git, "git://github.com/basho/rebar.git", {branch, "master"}},
         [{alt_url, "https://github.com/basho/rebar.git"}]}]}.

如您所见,您指出的特定参数与Erlang应用程序的版本(用作OTP应用程序)有关。版本显示在Erlang Application files