2.5.1 Module anvl_erlc

A wrapper for erlc, the Erlang compiler.

2.5.1.1 Types

check_applications()

-type check_applications() :: [application()] |
                              umbrella.

List of applications that should be statically analyzed.

A special value umbrella means: all applications defined by the root project.

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 anvl_erlc:context/0.

context()

-type context() :: #{project := anvl_project:t(),
                     app := atom(),
                     src_root := file:filename_all(),
                     build_root := file:filename_all(),
                     build_dir := file:filename_all(),
                     compile_options := list(),
                     first_files := [string()],
                     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.

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().

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).

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.

plugin_compiled(Plugin)

-spec
     plugin_compiled(anvl_plugin:t()) -> anvl_condition:t().

Condition: ANVL plugin is compiled.

pcfg(Project, Profile, Key)

-spec pcfg(anvl_project:t(), profile(),
           lee:key()) -> term().

Helper function that gets project configuration from Erlang subtree with overrides for the given profile.

pcfg(Project, Key)

-spec pcfg(anvl_project:t(), lee:key()) -> _.

Helper function that gets project configuration from Erlang subtree.

app_closure(Profile, Apps)

-spec app_closure(profile(),
                  [application()]) -> {[application()],
                                       [application()]}.

Return a closure of dependencies for a given set of OTP applications. Note: this function builds all applications.

Return value is a tuple with the following elements:

  1. Non-OTP applications and non-OTP dependencies
  2. Dependencies built into OTP

app_path(Profile, App)

-spec app_path(profile(),
               application()) -> file:filename().

Return a path to the library.

Note: library will be built as a side-effect.

add_pre_compile_hook(Project, Fun)

-spec add_pre_compile_hook(anvl_project:t(),
                           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:t(),
                        fun((application_spec()) -> application_spec())) -> ok.

beam_file/2

-spec beam_file(context(),
                module()) -> file:filename().

app_file(Ctx)

-spec app_file(#{app := application(),
                 build_dir := file:filename_all(),
                 _ => _}) -> file:filename().

umbrella(Profile, Project)

-spec umbrella(profile(),
               anvl_project:t()) -> [application()].

Return list of Erlang/OTP applications defined in a project.


JavaScript license information