开发者

Is there a convention for placing rebar in the search path?

开发者 https://www.devze.com 2023-03-26 18:25 出处:网络
I\'m attempting to understand how to build a multiple-application Erlang OTP release using Rebar. My applications include Webmachine, Riak, and a few applications of my own devising. So far, I have b

I'm attempting to understand how to build a multiple-application Erlang OTP release using Rebar.

My applications include Webmachine, Riak, and a few applications of my own devising. So far, I have been running Rebar successfully in the application root directory. But the Rebar bootstrap program suggests that there may be a better way. E.g.:

"You now have a self-contained script called "rebar" in your current working directory. Place this script anywhere in your path and you can use rebar to build OTP-compliant apps."

I can think of several ways to do this. But I'm wondering:

Is there is a preferred convent开发者_如何学编程ion: e.g., placing Rebar in an .erlang file, /usr/local/bin, etc., etc.?

Many thanks,

LRP


I keep a copy in /usr/local/bin, which I use when creating new apps. For example:

$ rebar create-app appid=myapp

All of my projects are built with rebar by placing the binary in the root directory of my project and referencing it locally in my Makefile as seen here. As of this writing, this seems to be the convention the community has adopted. For example, nitrogen, mochiweb, ibrowse, and erlydtl are all built this way.

Personally, I'm not a big fan of including the rebar binary with every project but I don't see a good alternative. It makes life easier for people that either don't have rebar in their path, or don't have an updated version in their path.

I suspect this is a temporary situation. Eventually the rebar project will start to have fewer commits, and we'll all agree to keep a copy in our path. At that point we can all stop including it. Of course, if your projects are only going to be used by you, this is a non-issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号