rebar3

Rebar3

Rebar3 build tool patterns for managing Erlang/OTP project dependencies, builds, and production releases

Details

Language / Topic
erlangErlang
Category
framework
Compatible Frameworks
rebar3

Rules

balanced
- Declare dependencies in `rebar.config`: `{deps, [{cowboy, "2.10.0"}, {jsone, {git, "https://github.com/sile/jsone", {tag, "1.8.1"}}}]}` — pin exact versions.
- Use the Rebar3 wrapper script: commit `rebar3` escript to version control — run all commands through it for reproducible builds.
- Build and test: `rebar3 compile`, `rebar3 eunit`, `rebar3 ct` — combine with `rebar3 do compile, eunit, ct` for a full pipeline.
- Build OTP releases: `rebar3 release` with `{relx, [{release, {my_app, "1.0.0"}, [my_app, sasl]}]}` in `rebar.config`.
- Use `rebar3 shell` for interactive development — starts your application with all deps loaded in the REPL.
- Run Dialyzer for static analysis: `rebar3 dialyzer` — cache PLTs in `_build/` and add `dialyze` to your CI pipeline.
- Configure test profiles: `{profiles, [{test, [{deps, [{meck, "0.9.2"}]}]}]}` — run with `rebar3 as test eunit`.
- Use `rebar3 hex publish` for hex.pm packages — configure `{hex, [{doc, ex_doc}]}` and `{project_plugins, [rebar3_ex_doc]}` for docs.