1.6.5 Module anvl_locate

This module provides a generic discovery mechanism for resolving external dependencies. It doesn’t do anything on its own, but acts as a broker between dependency resolver plugins (such as Git, Builtin ANVL Plugin) and dependency consumers.

1.6.5.1 Types

consumer_filter()
-type consumer_filter() :: [consumer()] | all.
locate_hook()
-type locate_hook() :: fun((spec()) -> hook_ret()).
hook_ret()
-type hook_ret() :: {true, file:filename_all()} | false.

Not exported

spec()
-type spec() :: #{id := id(), consumer := consumer()}.

Not exported

consumer()
-type consumer() :: module().

Not exported

id()
-type id() :: term().

1.6.5.2 Functions

match_consumer/2
-spec match_consumer(consumer(),
                     consumer_filter()) -> boolean().
add_hook(Fun, Priority)
-spec add_hook(locate_hook(), integer()) -> ok.

Add function Fun as a dependency discovery hook.

When multiple hooks are capable of resolving the dependency, hooks with higher Priority are chosen.

add_hook(Fun)
-spec add_hook(locate_hook()) -> ok.

Equivalent to add_hook(Fun, 0).

dir(Consumer, Id)
-spec dir(consumer(), id()) -> file:filename().

Return a directory that contains located dependency.

located(Consumer, Id)
-spec located(Consumer :: consumer(),
              Id :: id()) -> anvl_condition:t().

Condition: external dependency Dep has been located.


JavaScript license information