rebar rebar.config

rebar rebar.config在rebar使用构建系统时,可以手动创建一个rebar.config的文件,通过这个文件可以对rebar进行配置。这个文件中有两个参数比较重要%%Wheretoputanydownloadeddepandencies.Defaultis`deps’在哪里存放从网络上下载的依赖applications?1{deps_di

大家好,欢迎来到IT知识分享网。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/

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/14953.html

(0)

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信