rebar rebar.config

在rebar使用 构建系统时,可以手动创建一个rebar.config的文件,通过这个文件可以对rebar进行配置。

这个文件中有两个参数比较重要

%% Where to put any downloaded depandencies. Default is `deps’

在哪里存放从网络上下载的依赖applications

?
1
{deps_dir, [ "deps" ]}.

实际上这个参数还有另外一层意思,就是deps_dir,中所指定的目录,可以用做当前的项目依赖项目的存储目录。

在使用rebar进行构建时,rebar会在deps_dir指定的目录中去查找相关的依赖。

%% What dependancies we have, depandencies can be of 3 forms, an application

%% name as an atom, eg. mochiweb, a name and a version (from the .app file), or

%% an application name, a version and the SCM details on how to fetch it (SCM

%% type, location and revision). Rebar currently support git, hg, bzr and svn.

?
1
2
3
4
5
{deps, [application_name,
  
         {application_name, "1.0.*" },
  
         {application_name, "1.0.*" , {hg, "http://bitbucket.org/basho/rebar/" , "f3626d5858a6" }}]}.

deps参数的说明很清楚,rebar是支持从scm系统中获取依赖项目的。

从scm中获取的依赖将存储到deps_dir所指定的目录中。当前支持hg,svn,hg,bzr四种scm。

同时deps参数是支持erlang的正则表达式的。这样我们可以对依赖应用的版本进行控制

rebar还能够支持对driver代码的编译,虽说支持的不是很完整。

我们可以通过port_pre_script所指定的脚本对c/c++的编译进行扩展

%% Tuple which specifies a pre-compilation script to run, and a filename that

%% exists as a result of the script running.

?
1
{port_pre_script, { "script.sh" , "skipfile" }}.

这样一个erlang项目的搭建就不算是太大的问题了

 

转载:http://www.erlangsir.com/2011/05/27/rebar-rebar-config/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值