https://github.com/rebar/rebar/wiki
本章原文:
https://github.com/rebar/rebar/wiki/Getting-started
Rebar 是功能丰富的 Erlang 构建工具。用于Erlang/OTP项目的编译,测试,依赖管理,打包发布等。
Rebar 是自包含的脚本,可以方便地嵌入到项目中。 $ git clone git://github.com/rebar/rebar.git
$ cd rebar
$ ./bootstrap 查看命令说明: $ ./rebar -c
$ ./rebar help clean $ mkdir myapp
$ cd myapp$ cp ../rebar/rebar .
$ ./rebar create-app appid=myapp
$ touch rebar.config$ ./rebar compile
$ ./rebar clean
-export([start/2, stop/1]). 后面添加:
%% eunit testing
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif. %% eunit testing
-ifdef(TEST).
simple_test() ->
ok = application:start(myapp),
?assertNot(undefined == whereis(myapp_sup)).
-endif.$ ./rebar compile eunit
{cover_enabled, true}.$ rebar compile eunit
原文:http://blog.csdn.net/ubuntu64fan/article/details/41644773