1.7.7 Module anvl_project

This module contains routines for managing ANVL projects.

1.7.7.1 Callbacks

init/1
-callback init(t()) -> term().

An optional callback that is executed after loading the plugins and project configuration. Project can use it, for example, to install hooks.

Project’s own ID is passed as an argument.

conf_override/1
-callback conf_override(t()) -> lee:patch().

See Project Configuration Override

conf()
-callback conf() -> conf_tree().

See Project Configuration

1.7.7.2 Types

pre_project_load_hook()
-type
     pre_project_load_hook() :: fun((file:filename()) -> _).

Not exported

conf_tree()
-type conf_tree() :: #{atom() | [atom()] =>
                           conf_tree() | [conf_tree()] | term()}.
t()

An opaque type uniquely identifying an ANVL project.

API consumers can compare values of t() for (in)equality, but should not assume anything else about this type.

1.7.7.3 Functions

is_project(Dir)
-spec is_project(file:filename()) -> boolean().

Return true if input directory is an ANVL project.

add_pre_project_load_hook(Priority, Hook)
-spec add_pre_project_load_hook(integer(),
                                pre_project_load_hook()) -> ok.
add_pre_project_load_hook(Hook)
-spec
     add_pre_project_load_hook(pre_project_load_hook()) -> ok.
plugins(Project)
-spec plugins(Project :: t()) -> [anvl_plugin:t()].
conditions()
root_dir()
-spec root_dir() -> file:filename().

Return directory of the root project. Root project is the one where anvl was called.

root()
-spec root() -> t().
list_conf(Project, Key)
-spec list_conf(t(), lee:model_key()) -> list().

List project configuration.

maybe_conf(ProjectRoot, Key)
-spec maybe_conf(t(), lee:key()) -> {ok, _Result} |
                                    undefined.

Get a value from project configuration, non-throwing version.

conf(Project, Key)
-spec conf(t(), lee:key()) -> term().

Get a value from project configuration.

config_module/1
-spec config_module(t()) -> module().
project_of_dir(ProjectDir0)
-spec project_of_dir(file:filename()) -> t().

Load a project located in the specified directory, and return project ID.

dir(Project)
-spec dir(t()) -> file:filename().

Return directory containing a project.

loaded(ProjectDir)
-spec loaded(file:filename()) -> anvl_condition:t().

Condition: project configuarion is loaded.


JavaScript license information