rebar3 的使用

最近重新拾起erlang作一個業餘項目,以前一直用rebar來構建工程。在rebar的項目主頁看到We encourage you to move to https://github.com/erlang/rebar3的字樣. 因而就去用了一下rebar3。
rebar3 和rebar有太大改變了。簡單記錄一下使用功能:linux

安裝

$ git clone https://github.com/erlang/rebar3.git
$ cd rebar3
$ ./bootstrap
$ ./rebar3 local install
===> Extracting rebar3 libs to ~/.cache/rebar3/lib...
===> Writing rebar3 run script ~/.cache/rebar3/bin/rebar3...
===> Add to $PATH for use: export PATH=$PATH:~/.cache/rebar3/bin

使用

建立

$ rebar3 new
app (custom): Complete OTP Application structure. 
cmake (custom): Standalone Makefile for building C/C++ in c_src
escript (custom): Complete escriptized application structure
lib (custom): Complete OTP Library application (no processes) structure
plugin (custom): Rebar3 plugin project structure
release (custom): OTP Release structure for executable programs

編譯

rebar3 compile

發佈

rebar3 release

總結

在我開發的時候用rebar3 release 編譯調試特別麻煩。 咱們只要用rebar3 compile 去編譯而後運行 rebar3 shell 去調試程序。rebar3 構建的工程文件夾層次都太深了,開發起來很不方便,在linux咱們能夠用一下軟鏈接。git

相關文章
相關標籤/搜索