rebar3 的使用

最近从新拾起erlang做一个业余项目,之前一直用rebar来构建工程。在rebar的项目主页看到We encourage you to move to https://github.com/erlang/rebar3的字样. 于是就去用了一下rebar3。
rebar3 和rebar有太大改变了。简单记录一下使用功能:

安装

$ 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我们可以用一下软连接。

    原文作者:红色贪吃蛇
    原文地址: https://segmentfault.com/a/1190000005754196
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞