Erlang Build Tools--系列2

Rebar是一款用于Erlang项目的构建工具,支持常见的开发活动如编译、单元测试、静态分析等。它还支持依赖管理和文档生成,并能构建OTP嵌入式系统。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载:https://bitbucket.org/basho/rebar/wiki/Commands

Commands

Rebar provides support for the most commonly encountered development activities, include:

  • compilation
  • unit testing and coverage analysis
  • static analysis (through Dialyzer and Xref ).
  • documentation generation
  • dependency management

In addition, it allows for OTP embedded system generation, taking advantage of the template processing afforded by rebar and the reltool application.

The most common commands are:

CommandDescription
compileCompile all the available source in the project.
eunitPerform unit testing using the Eunit application
docGenerate documention using the Edoc application
cleanRemove any generated artifacts from compilation, unit testing, etc.

Less commonly used commands (in alphabetical order):

CommandDescription
analyzePerform static analysis on the project using Dialyzer
build_pltBuild the Dialyzer PLT; see the Dialyzer documentation for more details
check_pltCheck whether the Dialyzer PLT is up-to-date, rebuilding it if necessary
createCreate a prototypical project (described by the supplied template)
create-appCreate a prototypical OTP application (described by the priv/templates/simpleapp.template template)
create-nodeCreate a prototypical OTP embedded system (described by the priv/templates/simplenode.reltool.config template)
delete-depsDelete the downloaded source for dependencies specified in rebar.config
generateUse the Reltool application to construct an embedded system
get-depsRetrieve the source for dependencies specified in the rebar.config
xrefUse the Xref application to analyze dependencies

Supported Source Formats

Rebar is capable of compiling a number of different source files via the "compile" command.

SourceTargetDescription
src/*.erlebin/*.beamErlang source files
src/*.app.srcebin/*.appErlang application specification
c_src/*.cpriv/<app>.soC code for a port driver or NIF shared library
mibs/*.mibpriv/mibs/*.binSNMP mib files
src/*.xrlsrc/*.erlLeex analyzer generator files
src/*.yrlsrc/*.erlYecc parser generator files
asn1/*.asn1src/*.erlASN-1 files
templates/*.dtlebin/*_dtl.beamErlyDTL template files (requires ErlyDTL to be installed)
src/*.lfeebin/*.beamLFE source files (requires LFE to be installed)
src/*.pegebin/*.beamNeotoma PEG grammars (requires Neotoma to be installed)
src/*.protoebin/*_pb.beam, include/*_pb.hrlProtocol Buffers specifications (requires protobuffs to be installed)

Options

Options for the various commands are given in the rebar.config configuration file. They are listed, below.

CommandOptionsDescription
compileerl_first_files The list of erlang source files that should be compiled ahead of any other (for example, behavior modules)
compileerl_opts The options supported by the compile module, as described, here
compilemib_first_files The list of mib files that should be compiled ahead of any other (for example, RFC mibs which are referenced in a mib file's IMPORTS section)
compilesrc_dirs List of additional directories (beyond the src directory) containing Erlang source files
compileerlydtl_opts See ErlyDTL Templates for details on the supported options
cleanclean_files List of files to delete; this is in addition to the files deleted by the clean command for a specific module
docedoc_opts The options supported but the edoc module, as described, here
euniteunit_opts The options supported but the eunit module, as described, here
eunitcover_enabled Enable coverage analysis of Erlang programs
euniteunit_compile_opts Same options as erl_opts to be used for eunit specific compile settings in addition to erl_opts
analyzedialyzer_opts Specify alternative Dialyzer PLT file
build_pltdialyzer_opts Specify alternative Dialyzer PLT file
check_pltdialyzer_opts Specify alternative Dialyzer PLT file
get-deps, delete-depsbase_dir Specify alternative base directory for deps_dir
get-deps, delete-depsdeps_dir Specify alternative directory for storing deps
get-deps, delete-depsdeps List of dependencies
generatetarget_dir Target directory
generateoverlay_vars Overlay variables file
xrefxref_warnings Enable xref warnings
xrefxref_checks

The options supported by the xref module analyze/3 functions, as described, here

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值