• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H03-Sep-2021-227184

_build/H03-May-2022-25,51220,007

_checkouts/H03-May-2022-25,51220,007

manpages/H03-Sep-2021-468435

priv/H03-Sep-2021-1,3751,157

src/H03-May-2022-32,39924,405

systest/H03-Sep-2021-301198

test/H03-Sep-2021-17,56413,481

.dockerignoreH A D03-Sep-202165 86

.editorconfigH A D03-Sep-2021307 1411

.gitignoreH A D03-Sep-2021274 2826

CONTRIBUTING.mdH A D03-Sep-202112.5 KiB323250

DockerfileH A D03-Sep-20211.5 KiB4435

LICENSEH A D03-Sep-20219.9 KiB179150

README.mdH A D03-Sep-202110.2 KiB171131

THANKSH A D03-Sep-20212.1 KiB149147

bootstrapH A D03-May-202230.2 KiB844646

bootstrap.batH A D03-Sep-202135 32

bootstrap.ps1H A D03-Sep-202130 21

pr2relnotes.shH A D03-Sep-2021609 2620

rebar.configH A D03-May-20223.6 KiB9581

rebar.config.sampleH A D03-Sep-20218.8 KiB280217

rebar.lockH A D03-Sep-20212.4 KiB3635

vendor_hex_core.shH A D03-Sep-2021384 1915

README.md

1# Rebar3
2
3[![Build Status](https://github.com/erlang/rebar3/workflows/Common%20Test/badge.svg)](https://github.com/erlang/rebar3/actions?query=branch%3Amaster+workflow%3A"Common+Test") [![Erlang Versions](https://img.shields.io/badge/Supported%20Erlang%2FOTP-22.0%20to%2024.0-blue)](http://www.erlang.org)
4
51. [What is Rebar3?](#what-is-rebar3)
62. [Why Rebar3?](#why-rebar3)
73. [Should I Use Rebar3?](#should-i-use-rebar3)
84. [Getting Started](#getting-started)
95. [Documentation](#documentation)
106. [Features](#features)
117. [Migrating from rebar2](#migrating-from-rebar2)
128. [Additional Resources](#additional-resources)
13
14## What is Rebar3
15
16Rebar3 is an Erlang tool that makes it easy to create, develop, and
17release Erlang libraries, applications, and systems in a repeatable manner.
18
19Rebar3 will:
20- respect and enforce standard Erlang/OTP conventions for project
21  structure so they are easily reusable by the community;
22- manage source dependencies and Erlang [packages](https://hex.pm)
23  while ensuring repeatable builds;
24- handle build artifacts, paths, and libraries such that standard
25  development tools can be used without a headache;
26- adapt to projects of all sizes on almost any platform;
27- treat [documentation](https://rebar3.org/docs/) as a feature,
28  and errors or lack of documentation as a bug.
29
30Rebar3 is also a self-contained Erlang script. It is easy to distribute or
31embed directly in a project. Tasks or behaviours can be modified or expanded
32with a [plugin system](https://rebar3.org/docs/configuration/plugins)
33[flexible enough](https://github.com/lfe-rebar3/rebar3_lfe) that even other languages
34on the Erlang VM will use it as a build tool.
35
36## Why Rebar3
37
38Rebar3 is the spiritual successor to [rebar
392.x](https://github.com/rebar/rebar), which was the first usable build tool
40for Erlang that ended up seeing widespread community adoption. It however
41had several shortcomings that made it difficult to use with larger projects
42or with teams with users new to Erlang.
43
44Rebar3 was our attempt at improving over the legacy of Rebar 2.x, providing the
45features we felt it was missing, and to provide a better environment in which
46newcomers joining our teams could develop.
47
48## Should I use Rebar3?
49
50If your main language for your system is Erlang, that you value repeatable builds
51and want your various tools to integrate together, we do believe Rebar3 is the
52best experience you can get.
53
54## Getting Started
55
56A [getting started guide is maintained on the official documentation website](https://rebar3.org/docs/getting-started),
57but installing rebar3 can be done by any of the ways described below
58
59Latest stable compiled version:
60```bash
61$ wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
62```
63
64From Source (assuming you have a full Erlang install):
65
66```bash
67$ git clone https://github.com/erlang/rebar3.git
68$ cd rebar3
69$ ./bootstrap
70```
71
72Stable versions can also be obtained from the [releases page](https://github.com/erlang/rebar3/releases).
73
74The rebar3 escript can also extract itself with a run script under the user's home directory:
75
76```bash
77$ ./rebar3 local install
78===> Extracting rebar3 libs to ~/.cache/rebar3/lib...
79===> Writing rebar3 run script ~/.cache/rebar3/bin/rebar3...
80===> Add to $PATH for use: export PATH=~/.cache/rebar3/bin:$PATH
81```
82
83To keep it up to date after you've installed rebar3 this way you can use `rebar3 local upgrade` which
84fetches the latest stable release and extracts to the same place as above. A [nightly version can
85also be obtained](https://s3.amazonaws.com/rebar3-nightly/rebar3) if desired.
86
87Rebar3 may also be available on various OS-specific package managers such as
88FreeBSD Ports. Those are maintained by the community and Rebar3 maintainers
89themselves are generally not involved in that process.
90
91If you do not have a full Erlang install, we recommend using [erln8](https://erln8.github.io/erln8/)
92or [kerl](https://github.com/yrashk/kerl). For binary packages, use those provided
93by [Erlang Solutions](https://www.erlang-solutions.com/resources/download.html),
94but be sure to choose the "Standard" download option or you'll have issues building
95projects.
96
97Do note that if you are planning to work with multiple Erlang versions on the same machine, you will want to build Rebar3 with the oldest one of them. The 3 newest major Erlang releases are supported at any given time: if the newest version is OTP-24, building with versions as old as OTP-22 will be supported, and produce an executable that will work with those that follow.
98
99## Documentation
100
101Rebar3 documentation is maintained on [https://rebar3.org/docs](https://rebar3.org/docs)
102
103## Features
104
105Rebar3 supports the following features or tools by default, and may provide many
106others via the plugin ecosystem:
107
108| features             | Description |
109|--------------------- |------------ |
110| Command composition  | Rebar3 allows multiple commands to be run in sequence by calling `rebar3 do <task1>,<task2>,...,<taskN>`. |
111| Command dependencies | Rebar3 commands know their own dependencies. If a test run needs to fetch dependencies and build them, it will do so. |
112| Command namespaces   | Allows multiple tools or commands to share the same name. |
113| Compiling            | Build the project, including fetching all of its dependencies by calling `rebar3 compile` |
114| Clean up artifacts   | Remove the compiled beam files from a project with `rebar3 clean` or just remove the `_build` directory to remove *all* compilation artifacts |
115| Code Coverage        | Various commands can be instrumented to accumulate code coverage data (such as `eunit` or `ct`). Reports can be generated with `rebar3 cover` |
116| Common Test          | The test framework can be run by calling `rebar3 ct` |
117| Dependencies         | Rebar3 maintains local copies of dependencies on a per-project basis. They are fetched deterministically, can be locked, upgraded, fetched from source, packages, or from local directories. See [Dependencies on the documentation website](https://rebar3.org/docs/configuration/dependencies/). Call `rebar3 tree` to show the whole dependency tree. |
118| Documentation        | Print help for rebar3 itself (`rebar3 help`) or for a specific task (`rebar3 help <task>`). Full reference at [rebar3.org](https://rebar3.org/docs). |
119| Dialyzer             | Run the Dialyzer analyzer on the project with `rebar3 dialyzer`. Base PLTs for each version of the language will be cached and reused for faster analysis |
120| Edoc                 | Generate documentation using edoc with `rebar3 edoc` |
121| Escript generation   | Rebar3 can be used to generate [escripts](http://www.erlang.org/doc/man/escript.html) providing an easy way to run all your applications on a system where Erlang is installed |
122| Eunit                | The test framework can be run by calling `rebar3 eunit` |
123| Locked dependencies  | Dependencies are going to be automatically locked to ensure repeatable builds. Versions can be changed with `rebar3 upgrade` or `rebar3 upgrade <app>`, or locks can be released altogether with `rebar3 unlock`. |
124| Packages             | A given [Hex package](https://hex.pm) can be inspected `rebar3 pkgs <name>`. This will output its description and available versions |
125| Path                 | While paths are managed automatically, you can print paths to the current build directories with `rebar3 path`. |
126| Plugins              | Rebar3 can be fully extended with [plugins](https://rebar3.org/docs/configuration/plugins/). List or upgrade plugins by using the plugin namespace (`rebar3 plugins`). |
127| Profiles             | Rebar3 can have subconfiguration options for different profiles, such as `test` or `prod`. These allow specific dependencies or compile options to be used in specific contexts. See [Profiles](https://rebar3.org/docs/configuration/profiles) in the docs. |
128| Releases             | Rebar3 supports [building releases](https://rebar3.org/docs/deployment/releases) with the `relx` tool, providing a way to ship fully self-contained Erlang systems. Release update scripts for live code updates can also be generated. |
129| Shell                | A full shell with your applications available can be started with `rebar3 shell`. From there, call tasks as `r3:do(compile)` to automatically recompile and reload the code without interruption |
130| Tarballs             | Releases can be packaged into tarballs ready to be deployed. |
131| Templates            | Configurable templates ship out of the box (try `rebar3 new` for a list or `rebar3 new help <template>` for a specific one). [Custom templates](https://rebar3.org/docs/tutorials/templates) are also supported, and plugins can also add their own. |
132| Xref                 | Run cross-reference analysis on the project with [xref](http://www.erlang.org/doc/apps/tools/xref_chapter.html) by calling `rebar3 xref`. |
133
134## Migrating From rebar2
135
136The grievances we had with Rebar 2.x were not fixable without breaking
137compatibility in some very important ways.
138
139A full guide titled [From Rebar 2.x to Rebar3](https://rebar3.org/docs/tutorials/from_rebar2_to_rebar3/)
140is provided on the documentation website.
141
142Notable modifications include mandating a more standard set of directory
143structures, changing the handling of dependencies, moving some compilers (such
144as C, Diameter, ErlyDTL, or ProtoBuffs) to
145[plugins](https://rebar3.org/docs/configuration/plugins) rather than
146maintaining them in core rebar, and moving release builds from reltool to
147relx.
148
149## Additional Resources
150
151In the case of problems that cannot be solved through documentation or examples, you
152may want to try to contact members of the community for help. The community is
153also where you want to go for questions about how to extend rebar, fill in bug
154reports, and so on.
155
156If you need
157quick feedback, you can try the #rebar channel on
158[irc.freenode.net](https://freenode.net) or the #rebar3 channel on
159[erlanger.slack.com](https://erlanger.slack.com/). Be sure to check the
160[documentation](https://rebar3.org/docs) first, just to be sure you're not
161asking about things with well-known answers.
162
163For bug reports, roadmaps, and issues, visit the [github issues
164page](https://github.com/erlang/rebar3/issues).
165
166General rebar community resources and links can be found at
167[rebar3.org/docs/about/about-us/#community](https://rebar3.org/docs/about/about-us/#community)
168
169To contribute to rebar3, please refer to [CONTRIBUTING](CONTRIBUTING.md).
170
171