rebar_state (rebar v0.0.0+build.5492.ref67808dff)

View Source

Summary

Functions

register compiler modules. Each compiler module should implement the rebar_compiler behaviour. Use this when your custom compiler generates binary artifacts and does not have a particular need to run before any other compiler.

get a list of all registered compiler modules, which should implement the rebar_compiler behaviour

register compiler modules prior to the existing ones. Each compiler module should implement the rebar_compiler behaviour. Use this when your custom compiler generates .erl files (or files of another type) and that should run before other compiler modules.

Types

rebar_dict/0

-type rebar_dict() :: dict:dict().

t/0

-type t() ::
          #state_t{dir :: file:name(),
                   opts :: rebar_dict(),
                   code_paths :: rebar_dict(),
                   default :: rebar_dict(),
                   escript_path :: undefined | file:filename_all(),
                   lock :: term(),
                   current_profiles :: [atom()],
                   namespace :: atom(),
                   command_args :: term(),
                   command_parsed_args :: term(),
                   current_app :: undefined | rebar_app_info:t(),
                   project_apps :: [rebar_app_info:t()],
                   deps_to_build :: [rebar_app_info:t()],
                   all_plugin_deps :: [rebar_app_info:t()],
                   all_deps :: [rebar_app_info:t()],
                   compilers :: [module()],
                   project_builders :: [{rebar_app_info:project_type(), module()}],
                   resources :: term(),
                   providers :: term(),
                   allow_provider_overrides :: boolean()}.

Functions

add_project_builder(State, Type, Module)

add_provider(State, Provider)

-spec add_provider(t(), providers:t()) -> t().

add_resource(State, _)

-spec add_resource(t(), {rebar_resource_v2:type(), module()}) -> t().

add_to_profile(State, Profile, KVs)

all_checkout_deps(State_t)

all_deps(State_t)

all_deps(State, NewApps)

all_plugin_deps(State_t)

all_plugin_deps(State, NewApps)

allow_provider_overrides(State_t)

allow_provider_overrides(State, Allow)

append_compilers(State, NewCompilers)

-spec append_compilers(t(), [module()]) -> t().

register compiler modules. Each compiler module should implement the rebar_compiler behaviour. Use this when your custom compiler generates binary artifacts and does not have a particular need to run before any other compiler.

apply_profiles(State, Profile)

code_paths(State_t, Key)

-spec code_paths(#state_t{dir :: file:name(),
                          opts :: rebar_dict(),
                          code_paths :: rebar_dict(),
                          default :: rebar_dict(),
                          escript_path :: undefined | file:filename_all(),
                          lock :: term(),
                          current_profiles :: [atom()],
                          namespace :: atom(),
                          command_args :: term(),
                          command_parsed_args :: term(),
                          current_app :: undefined | rebar_app_info:t(),
                          project_apps :: [rebar_app_info:t()],
                          deps_to_build :: [rebar_app_info:t()],
                          all_plugin_deps :: [rebar_app_info:t()],
                          all_deps :: [rebar_app_info:t()],
                          compilers :: [module()],
                          project_builders :: [{rebar_app_info:project_type(), module()}],
                          resources :: term(),
                          providers :: term(),
                          allow_provider_overrides :: boolean()},
                 atom()) ->
                    [file:filename()].

code_paths(State_t, Key, CodePath)

-spec code_paths(#state_t{dir :: file:name(),
                          opts :: rebar_dict(),
                          code_paths :: rebar_dict(),
                          default :: rebar_dict(),
                          escript_path :: undefined | file:filename_all(),
                          lock :: term(),
                          current_profiles :: [atom()],
                          namespace :: atom(),
                          command_args :: term(),
                          command_parsed_args :: term(),
                          current_app :: undefined | rebar_app_info:t(),
                          project_apps :: [rebar_app_info:t()],
                          deps_to_build :: [rebar_app_info:t()],
                          all_plugin_deps :: [rebar_app_info:t()],
                          all_deps :: [rebar_app_info:t()],
                          compilers :: [module()],
                          project_builders :: [{rebar_app_info:project_type(), module()}],
                          resources :: term(),
                          providers :: term(),
                          allow_provider_overrides :: boolean()},
                 atom(),
                 [file:filename()]) ->
                    #state_t{dir :: file:name(),
                             opts :: rebar_dict(),
                             code_paths :: rebar_dict(),
                             default :: rebar_dict(),
                             escript_path :: undefined | file:filename_all(),
                             lock :: term(),
                             current_profiles :: [atom()],
                             namespace :: atom(),
                             command_args :: term(),
                             command_parsed_args :: term(),
                             current_app :: undefined | rebar_app_info:t(),
                             project_apps :: [rebar_app_info:t()],
                             deps_to_build :: [rebar_app_info:t()],
                             all_plugin_deps :: [rebar_app_info:t()],
                             all_deps :: [rebar_app_info:t()],
                             compilers :: [module()],
                             project_builders :: [{rebar_app_info:project_type(), module()}],
                             resources :: term(),
                             providers :: term(),
                             allow_provider_overrides :: boolean()}.

command_args(State_t)

command_args(State, CmdArgs)

command_parsed_args(State_t)

command_parsed_args(State, CmdArgs)

compilers(State_t)

-spec compilers(t()) -> [module()].

get a list of all registered compiler modules, which should implement the rebar_compiler behaviour

create_logic_providers(ProviderModules, State0)

create_resources(Resources, State)

current_app(State_t)

current_app(State, CurrentApp)

current_profiles(State_t)

current_profiles(State, Profiles)

default(State_t)

default(State, Opts)

default_hex_repo_url_override(State)

-spec default_hex_repo_url_override(t()) -> binary().

deps_names(Deps)

deps_to_build(State_t)

deps_to_build(State, NewApps)

dir(State_t)

dir(State, Dir)

escript_path(State_t)

escript_path(State, EscriptPath)

format_error(_)

get(State, Key)

get(State, Key, Default)

has_all_artifacts(State_t)

-spec has_all_artifacts(#state_t{dir :: file:name(),
                                 opts :: rebar_dict(),
                                 code_paths :: rebar_dict(),
                                 default :: rebar_dict(),
                                 escript_path :: undefined | file:filename_all(),
                                 lock :: term(),
                                 current_profiles :: [atom()],
                                 namespace :: atom(),
                                 command_args :: term(),
                                 command_parsed_args :: term(),
                                 current_app :: undefined | rebar_app_info:t(),
                                 project_apps :: [rebar_app_info:t()],
                                 deps_to_build :: [rebar_app_info:t()],
                                 all_plugin_deps :: [rebar_app_info:t()],
                                 all_deps :: [rebar_app_info:t()],
                                 compilers :: [module()],
                                 project_builders :: [{rebar_app_info:project_type(), module()}],
                                 resources :: term(),
                                 providers :: term(),
                                 allow_provider_overrides :: boolean()}) ->
                           true | {false, file:filename()}.

lock(State_t)

lock(State, Apps)

merge_all_deps(State, UpdatedApps)

namespace(State_t)

namespace(State, Namespace)

new()

-spec new() -> t().

new(Config)

-spec new(list()) -> t().

new(Profile, Config)

-spec new(t() | atom(), list()) -> t().

new(ParentState, Config, Dir)

-spec new(t(), list(), file:filename_all()) -> t().

opts(State_t)

opts(State, Opts)

prepend_compilers(State, NewCompilers)

-spec prepend_compilers(t(), [module()]) -> t().

register compiler modules prior to the existing ones. Each compiler module should implement the rebar_compiler behaviour. Use this when your custom compiler generates .erl files (or files of another type) and that should run before other compiler modules.

project_apps(State_t)

project_apps(State, NewApps)

project_builders(State_t)

providers(State_t)

providers(State, NewProviders)

resources(State_t)

-spec resources(t()) -> [{rebar_resource_v2:type(), module()}].

resources(State, NewResources)

-spec resources(t(), [{rebar_resource_v2:type(), module()}]) -> t().

set(State, Key, Value)

-spec set(t(), any(), any()) -> t().

set_resources(State, Resources)

-spec set_resources(t(), [{rebar_resource_v2:type(), module()}]) -> t().

to_list(State_t)

update_all_deps(State, NewApps)

update_all_plugin_deps(State, NewApps)

update_code_paths(State_t, Key, CodePath)

-spec update_code_paths(#state_t{dir :: file:name(),
                                 opts :: rebar_dict(),
                                 code_paths :: rebar_dict(),
                                 default :: rebar_dict(),
                                 escript_path :: undefined | file:filename_all(),
                                 lock :: term(),
                                 current_profiles :: [atom()],
                                 namespace :: atom(),
                                 command_args :: term(),
                                 command_parsed_args :: term(),
                                 current_app :: undefined | rebar_app_info:t(),
                                 project_apps :: [rebar_app_info:t()],
                                 deps_to_build :: [rebar_app_info:t()],
                                 all_plugin_deps :: [rebar_app_info:t()],
                                 all_deps :: [rebar_app_info:t()],
                                 compilers :: [module()],
                                 project_builders :: [{rebar_app_info:project_type(), module()}],
                                 resources :: term(),
                                 providers :: term(),
                                 allow_provider_overrides :: boolean()},
                        atom(),
                        [file:filename()]) ->
                           #state_t{dir :: file:name(),
                                    opts :: rebar_dict(),
                                    code_paths :: rebar_dict(),
                                    default :: rebar_dict(),
                                    escript_path :: undefined | file:filename_all(),
                                    lock :: term(),
                                    current_profiles :: [atom()],
                                    namespace :: atom(),
                                    command_args :: term(),
                                    command_parsed_args :: term(),
                                    current_app :: undefined | rebar_app_info:t(),
                                    project_apps :: [rebar_app_info:t()],
                                    deps_to_build :: [rebar_app_info:t()],
                                    all_plugin_deps :: [rebar_app_info:t()],
                                    all_deps :: [rebar_app_info:t()],
                                    compilers :: [module()],
                                    project_builders :: [{rebar_app_info:project_type(), module()}],
                                    resources :: term(),
                                    providers :: term(),
                                    allow_provider_overrides :: boolean()}.