Reprinted: 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
Template processing afforded by rebar and the reltool
Application.
The most common commands are:
Command |
Description |
Compile |
Compile all the available source in the project. |
Eunit |
Perform unit testing using the eunit Application |
Doc |
Generate authentication ention using the edoc Application |
Clean |
Remove any generated artifacts from compilation, Unit Testing, etc. |
Less commonly used commands (in alphabetical order ):
Command |
Description |
Analyze |
Perform static analysis on the project using dialyzer |
Build_plt |
Build the dialyzer PLT; see the dialyzer Documentation For more details |
Check_plt |
Check whether the dialyzer PLT is up-to-date, Rebuilding it if necessary |
Create |
Create a prototypical Project (described by Supplied template) |
Create-app |
Create a prototypical OTP Application (Described by Priv/templates/simpleapp. Template Template) |
Create-node |
Create a prototypical OTP Embedded System (Described by Priv/templates/simplenode. reltool. config Template) |
Delete-deps |
Delete the downloaded source Dependencies specified in rebar. config |
Generate |
Use the reltool Application to construct an Embedded System |
Get-deps |
Retrieve the source for dependencies specified In the rebar. config |
Xref |
Use the xref Application Analyze Dependencies |
Supported source formats
Rebar is capable of compiling a number of different source files
The "compile" command.
Source |
Target |
Description |
Src/*. erl |
Ebin/*. Beam |
Erlang source files |
Src/*. App. SRC |
Ebin/*. app |
Erlang Application Specification |
C_src/*. c |
Priv/<app>. So |
C code for a port Driver or nif shared library |
Mibs/*. MIB |
Priv/mibs/*. Bin |
Snmp mib files |
Src/*. XRL |
Src/*. erl |
Leex analyzer Generator Files |
Src/*. yrl |
Src/*. erl |
Yecc Parser Generator files |
ASN1/*. ASN1 |
Src/*. erl |
ASN-1 files |
Templates/*. DTL |
Ebin/* _ DTL. Beam |
Erlydtl Template Files (requires erlydtl to be installed) |
Src/*. LFE |
Ebin/*. Beam |
LFE source files (requires LFE to be installed) |
Src/*. Peg |
Ebin/*. Beam |
Neotoma peg Grammars (Requires neotoma to be installed) |
Src/*. proto |
Ebin/* _ PB. Beam, include/* _ PB. HRL |
Protocol Buffers specifications (requires protobuffs to be installed) |
Options
Options for the varous commands are given inrebar.config
Configuration file. They are
Listed, below.
Command |
Options |
Description |
Compile |
erl_first_files |
The list Erlang source files that shoshould be compiled ahead of any other ( Example,Behavior Modules) |
Compile |
erl_opts |
The options Supported bycompile Module, as described, here |
Compile |
mib_first_files |
The list MIB files that shoshould be compiled ahead of any other (for example, RFC Mibs which are referenced in a MIB file's imports Section) |
Compile |
src_dirs |
List of additional Directories (beyondsrc Directory) containing Erlang Source files |
Compile |
erlydtl_opts |
See erlydtl Templates For details on the supported options |
Clean |
clean_files |
List of files Delete; this is in addition to the files deleted byclean Command for a specific module |
Doc |
edoc_opts |
The options supported Butedoc Module, as described, here |
Eunit |
eunit_opts |
The options Supported buteunit Module, as described, here |
Eunit |
cover_enabled |
Enable coverage Analysis of Erlang programs |
Eunit |
eunit_compile_opts |
Same Optionserl_opts To be used for eunit specific compile Settings in additionerl_opts |
Analyze |
dialyzer_opts |
Specify Alternative dialyzer PLT File |
Build_plt |
dialyzer_opts |
Specify Alternative dialyzer PLT File |
Check_plt |
dialyzer_opts |
Specify Alternative dialyzer PLT File |
Get-deps, delete-deps |
base_dir |
Specify Alternative base directorydeps_dir |
Get-deps, delete-deps |
deps_dir |
Specify Alternative directory for storing deps |
Get-deps, delete-deps |
deps |
List Dependencies |
Generate |
target_dir |
Target Directory |
Generate |
overlay_vars |
Overlay Variables File |
Xref |
xref_warnings |
Enable xref Warnings |
Xref |
xref_checks |
The options Supported byxref Moduleanalyze/3 Functions, as described, here |