2.5.1 Module anvl_erlc

A builtin plugin for compiling Erlang applications.

2.5.1.1 Types

app_info()
-type app_info() :: #{app := atom(),
                      src_root := file:filename_all(),
                      build_root := file:filename_all(),
                      build_dir := file:filename_all(),
                      compile_options := list(),
                      sources := [anvl_lib:filename_pattern()],
                      includes := [file:filename_all()],
                      spec := application_spec(),
                      ebin_dir := file:filename_all()}.

Application info is a summary of data about the application that becomes available after application is built.

This type is an extention of context/0.

context()
-type context() :: #{project := anvl_project:dir(),
                     app := atom(), src_root := file:filename_all(),
                     build_root := file:filename_all(),
                     build_dir := file:filename_all(),
                     compile_options := list(),
                     sources := [anvl_lib:filename_pattern()],
                     includes := [file:filename_all()]}.

Build context: a summary of options and data about the application that is available at its build time.

escript_name()
-type escript_name() :: atom().
compile_options()
-type compile_options() :: #{includes =>
                                 [anvl_lib:filename_pattern()],
                             sources => [anvl_lib:filename_pattern()],
                             compile_options => list()}.
application_spec()
-type application_spec() :: {application,
                             application(),
                             [tuple()]}.
application()
-type application() :: atom().

Not exported

profile()
-type profile() :: atom().

2.5.1.2 Functions

app_info(Profile, App)
-spec app_info(profile(), application()) -> app_info().

Return various information about a compiled OTP application (precondition: app_compiled).

escript(A, B)
-spec escript(file:filename_all(),
              string()) -> anvl_condition:t().

Condition: escript has been built.

module(Profile, Module)
-spec module(profile(), module()) -> anvl_condition:t().

Speculative condition: a particular module has been compiled.

app_compiled(Profile, Application)
-spec app_compiled(Profile :: profile(),
                   Application :: application()) -> anvl_condition:t().

Condition: OTP application has been compiled with the given profile.

add_pre_compile_hook(Project, Fun)
-spec add_pre_compile_hook(anvl_project:dir(),
                           fun((context()) -> boolean())) -> ok.

Add a pre-compile hook. Functions hooked there will run after the dependencies are satisfied, but before building the application itself.

add_app_spec_hook(Project, Hook)
-spec add_app_spec_hook(anvl_project:dir(),
                        fun((application_spec()) -> application_spec())) -> ok.
beam_file/2
-spec beam_file(context(), module()) -> file:filename().
app_file(Ctx)
-spec app_file(context()) -> file:filename().

JavaScript license information