Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

State Modification

Fields Set During Initialization

FieldWhen SetValuePurpose
dirnew/0,1rebar_dir:get_cwd()Project root directory
optsnew/1Parsed rebar.configConfiguration options
defaultnew/1Copy of optsOriginal configuration before profile application
escript_pathinit_config/0Path to rebar3 escriptFor extracting embedded resources
locknew/3Parsed rebar.lockLocked dependency versions
current_profilesapply_profiles/2[default] or specifiedActive configuration profiles
compilersrun_aux/2[rebar_compiler_xrl, ...]Registered compiler modules
resourcesrun_aux/2[rebar_git_resource, ...]Resource modules for fetching deps
providerscreate_logic_providers/2List of provider recordsAvailable commands
command_argsrun_aux/2Remaining CLI argsArguments to pass to command

Configuration Keys in opts

Common configuration keys stored in the opts dictionary:

  • deps: List of dependencies
  • plugins: List of plugins
  • project_plugins: List of project-scoped plugins
  • profiles: Profile-specific configuration
  • erl_opts: Erlang compiler options
  • src_dirs: Source directories
  • extra_src_dirs: Additional source directories
  • minimum_otp_vsn: Minimum OTP version required
  • base_dir: Build output directory
  • artifacts: List of expected artifacts