2012-04-20 39 views
6

我們使用鋼筋來拉取我們項目的依賴項,其中很多來自github。我們的配置看起來像:螺紋鋼錠配置中元素的含義

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

我理解足以讓通過,並且我已經學會通過試驗和錯誤(例如,如何指定標籤和變更,而不是分公司),但我的谷歌有兩件事情-fu無法找到關於可用選項或其功能的全面文檔。

我特別想知道第二個值的用途是什麼(通常是空字符串,但我偶爾會看到其中的版本號和通配符),但有關源代碼管理選項的更多信息或者一般文檔都會對您有所幫助。

回答

7

你可以在這裏找到螺紋鋼的完整文檔:

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

詳細rebar.config樣本,顯示大多數可用的選項,請訪問:

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

閱讀從的DEP部分:

%% 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"}]}]}. 

正如你所看到的,你已經指出了具體的參數涉及二郎應用程序(意爲OTP應用程序)的版本。版本在Erlang Application files中指出。

+0

我曾看過維基,但沒有找到太多關於deps的內容。雖然我沒有遇到rebar.config.sample。謝謝。 – 2012-04-20 21:20:20