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) ([email protected])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"}] ([email protected])2> q(). ok ([email protected])3> [End] $ ./mynode start $ ./mynode stop ok
时间: 2024-10-11 00:44:16