anvl_erlc ¶A wrapper for erlc, the Erlang compiler.
-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.
-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.
-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.
-type compile_options() :: #{includes =>
[anvl_lib:filename_pattern()],
sources => [anvl_lib:filename_pattern()],
compile_options => list()}.
-type application_spec() :: {application,
application(),
[tuple()]}.
-type application() :: atom().
-type profile() :: atom().
-spec app_info(profile(), application()) -> app_info().
Return various information about a compiled OTP application
(precondition: app_compiled).
-spec module(profile(), module()) -> anvl_condition:t().
Speculative condition: a particular module has been compiled.
-spec app_compiled(Profile :: profile(),
Application :: application()) -> anvl_condition:t().
Condition: OTP application has been compiled with the given profile.
-spec
plugin_compiled(anvl_plugin:t()) -> anvl_condition:t().
Condition: ANVL plugin is compiled.
-spec pcfg(anvl_project:t(), profile(),
lee:key()) -> term().
Helper function that gets project configuration from Erlang subtree with overrides for the given profile.
-spec pcfg(anvl_project:t(), lee:key()) -> _.
Helper function that gets project configuration from Erlang subtree.
-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:
-spec app_path(profile(),
application()) -> file:filename().
Return a path to the library.
Note: library will be built as a side-effect.
-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.
-spec add_app_spec_hook(anvl_project:t(),
fun((application_spec()) -> application_spec())) -> ok.
-spec beam_file(context(), module()) -> file:filename().
-spec app_file(#{app := application(),
build_dir := file:filename_all(),
_ => _}) -> file:filename().
-spec umbrella(profile(),
anvl_project:t()) -> [application()].
Return list of Erlang/OTP applications defined in a project.