Skip to content

does not load custom tags and filters modules because code path does not contain path to the current app #21

@brigadier

Description

@brigadier

Plugin does not work with filter and tag libraries at least with erlang 26
assuming in the rebar.config in erlydtl options we have

{libraries, [{my_dtl_filters, my_dtl_filters_lib}]},
    {default_libraries, [my_dtl_filters]},

When we start rebar with something like rebar3 shell eventually the following lites are executed in the erlydtl_compiler_utils.erl:

lib_module(Name, #dtl_context{ libraries=Libs }) ->
    Mod = proplists:get_value(Name, Libs, Name),
    case code:ensure_loaded(Mod) of
        {module, Mod} ->

and code:ensure_loaded() always fails because path to the ebin of the current app is not in the code:get_path() yet.
I checked the difference between code path in this function and in the running app and as expected the difference was

["/home/evgeny/projects/myapp/myapp/_build/default/lib/myapp/ebin",
 "/home/evgeny/projects/myapp/myapp/apps/myapp"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions