Module rebar_core

Module providing core functionality about command dispatch, namespacing, and chaining for rebar3.

Description

Module providing core functionality about command dispatch, namespacing, and chaining for rebar3.

Function Index

do/2execute the selected providers.
format_error/1convert a given exception's payload into an io description.
init_command/2initial command set up; based on the first fragment of the command, dispatch to special environments.
process_command/2Dispatches a given command based on the current state.
process_namespace/2parse the commands starting at the namespace level; a namespace is found if the first keyword to match is not belonging to an existing provider, and iff the keyword also matches a registered namespace.

Function Details

do/2

do(Rest::[{atom(), atom()}], State::rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()} | {error, {module(), any()}}

execute the selected providers. If a chain of providers has been returned, run them one after the other, while piping the state from the first into the next one.

format_error/1

format_error(X1::any()) -> iolist()

convert a given exception's payload into an io description.

init_command/2

init_command(State::rebar_state:t(), Command::atom()) -> {ok, rebar_state:t()} | {error, term()}

initial command set up; based on the first fragment of the command, dispatch to special environments. The keywords for do and as are implicitly reserved here, barring them from being used as other commands or namespaces.

process_command/2

process_command(State::rebar_state:t(), Command::atom()) -> {ok, rebar_state:t()} | {error, string()} | {error, {module(), any()}}

Dispatches a given command based on the current state. This requires mapping a command name to a specific provider. as and do are still treated as special providers here. Basic profile application may also be run.

The function also takes care of expanding a provider to its dependencies in the proper order.

process_namespace/2

process_namespace(State::rebar_state:t(), Command::atom()) -> {error, term()} | {ok, rebar_state:t(), atom()}

parse the commands starting at the namespace level; a namespace is found if the first keyword to match is not belonging to an existing provider, and iff the keyword also matches a registered namespace. The command to run is returned last; for namespaces, some magic is done implicitly calling do as an indirect dispatcher.


Generated by EDoc