rebar rebar.config

來源:互聯網
上載者:User

在rebar使用 構建系統時,可以手動建立一個rebar.config的檔案,通過這個檔案可以對rebar進行配置。

這個檔案中有兩個參數比較重要

%% Where to put any downloaded depandencies. Default is `deps’

在哪裡存放從網路上下載的依賴applications

?
1 {deps_dir, ["deps"]}.

實際上這個參數還有另外一層意思,就是deps_dir,中所指定的目錄,可以用做當前的項目依賴項目的儲存目錄。

在使用rebar進行構建時,rebar會在deps_dir指定的目錄中去尋找相關的依賴。

%% What dependancies we have, depandencies 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 support git, hg, bzr and svn.

?
12345 {deps, [application_name,           {application_name, "1.0.*"},           {application_name, "1.0.*", {hg, "http://bitbucket.org/basho/rebar/", "f3626d5858a6"}}]}.

deps參數的說明很清楚,rebar是支援從scm系統中擷取依賴項目的。

從scm中擷取的依賴將儲存到deps_dir所指定的目錄中。當前支援hg,svn,hg,bzr四種scm。

同時deps參數是支援erlang的Regex的。這樣我們可以對依賴應用的版本進行控制

rebar還能夠支援對driver代碼的編譯,雖說支援的不是很完整。

我們可以通過port_pre_script所指定的指令碼對c/c++的編譯進行擴充

%% Tuple which specifies a pre-compilation script to run, and a filename that

%% exists as a result of the script running.

?
1 {port_pre_script, {"script.sh", "skipfile"}}.

這樣一個erlang項目的搭建就不算是太大的問題了

 

轉載:http://www.erlangsir.com/2011/05/27/rebar-rebar-config/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.