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

rebar_app_info Structure

Record Definition

-record(app_info_t, {
    name               :: binary() | undefined,
    app_file_src       :: file:filename_all() | undefined,
    app_file_src_script:: file:filename_all() | undefined,
    app_file           :: file:filename_all() | undefined,
    original_vsn       :: app_vsn() | undefined,
    vsn                :: app_vsn() | undefined,
    parent = root      :: binary() | root,
    app_details = []   :: list(),
    applications = []  :: list(),
    included_applications = [] :: [atom()],
    optional_applications = [] :: [atom()],
    deps = []          :: list(),
    profiles = [default] :: [atom()],
    default = dict:new() :: rebar_dict(),
    opts = dict:new()  :: rebar_dict(),
    dep_level = 0      :: integer(),
    fetch_dir          :: file:name(),
    dir                :: file:name(),
    out_dir            :: file:name(),
    ebin_dir           :: file:name(),
    source             :: source_spec(),
    is_lock = false    :: boolean(),
    is_checkout = false :: boolean(),
    valid              :: boolean() | undefined,
    project_type       :: rebar3 | mix | undefined,
    is_available = false :: boolean()
}).

Key Fields

FieldTypePurpose
namebinary()Application name
dirfile:name()Source directory
out_dirfile:name()Build output directory
ebin_dirfile:name()Compiled .beam files location
app_file_srcfile:filename()Path to .app.src
app_filefile:filename()Path to .app
vsnstring()Application version
applications[atom()]Runtime dependencies
deps[term()]Build dependencies
optsrebar_dict()App-specific configuration
dep_levelinteger()Depth in dependency tree
is_checkoutboolean()Whether from _checkouts/
project_typeatom()rebar3, mix, etc.

Common Operations

Create New AppInfo:

AppInfo = rebar_app_info:new(AppName, Vsn, Dir)

Get/Set Fields:

Name = rebar_app_info:name(AppInfo),
AppInfo1 = rebar_app_info:name(AppInfo, NewName),

Dir = rebar_app_info:dir(AppInfo),
AppInfo2 = rebar_app_info:dir(AppInfo1, NewDir)

Manage Configuration:

Opts = rebar_app_info:opts(AppInfo),
AppInfo1 = rebar_app_info:opts(AppInfo, NewOpts),

Value = rebar_app_info:get(AppInfo, Key, Default),
AppInfo2 = rebar_app_info:set(AppInfo1, Key, Value)

Apply Profiles:

AppInfo1 = rebar_app_info:apply_profiles(AppInfo, [test, prod])