您的位置:首页 > 其它

Erlang Rebar 使用指南之二:制作发布版本

2014-12-01 15:01 357 查看

Erlang Rebar 使用指南之二:制作发布版本

全文目录:
https://github.com/rebar/rebar/wiki

本章位置:

https://github.com/rebar/rebar/wiki/Release-handling
如何使用rebar打包和发布应用。

1 查看erlang版本

$ erl
Erlang/OTP 17 [erts-6.2] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.2 (abort with ^G)
1> q().
ok


2 创建项目

按照下面的命令创建一个新的项目test_rebar:
$ mkdir test_rebar
$ cd test_rebar/
$ cp ../rebar/rebar .
$ ./rebar create-app
$ mkdir rel
$ cd rel
$ ../rebar create-node
$ vi reltool.config
$ cd ..
$ echo "{sub_dirs,[\"rel\"]}.">rebar.config
$ ./rebar compile generate
==> rel (generate)
WARN:  'generate' command does not apply to directory ~/test_rebar
其中,$ vi reltool.config执行时,找到下面这行:
{app, mynode, [{mod_cond, app}, {incl_cond, include}]}更改为:
{app, mynode, [{mod_cond, app}, {incl_cond, include}, {lib_dir,".."}]}

3 运行

$ pwd
../test_rebar/rel/mynode/bin
$ ./mynode start
$ ./mynode attach
Attaching to /tmp//~/test_rebar/rel/mynode/erlang.pipe.1 (^D to exit)

(mynode@127.0.0.1)1> application:which_applications().
[{mynode,[],[]},
{sasl,"SASL CXC 138 11","2.4.1"},
{stdlib,"ERTS CXC 138 10","2.2"},
{kernel,"ERTS CXC 138 10","3.0.3"}]
(mynode@127.0.0.1)2> q().
ok
(mynode@127.0.0.1)3> [End]
$ ./mynode start
$ ./mynode stop
ok
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐