Skip to content

Commit 07fe5a3

Browse files
committed
Cleanup dialyzer provider
Cleans up `get_base_beam_path_list/1` used to search for base beam directories, and fixes a match bug if the libraries were not found when using a source build for `atomvm_root` option. Signed-off-by: Winford <winford@object.stream>
1 parent 69954c5 commit 07fe5a3

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

src/atomvm_dialyzer_provider.erl

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -281,36 +281,24 @@ default_base_beam_path() ->
281281

282282
%% @private
283283
get_base_beam_path_list(Base) ->
284-
NotFound = lists:duplicate(length(?LIBS), []),
285284
Libs =
286-
case
287-
lists:foldl(
288-
fun(E, Acc) ->
289-
[filelib:wildcard(Base ++ "/lib/" ++ atom_to_list(E) ++ "*/ebin") | Acc]
290-
end,
291-
[],
292-
?LIBS
293-
)
294-
of
295-
NotFound ->
296-
%% not a standard install, look for source build beams
297-
lists:foldl(
298-
fun(E, Acc) ->
299-
[
300-
filelib:wildcard(Base ++ "/libs/" ++ atom_to_list(E) ++ "*/src/beams")
301-
| Acc
302-
]
303-
end,
304-
[],
305-
?LIBS
306-
);
307-
Paths ->
308-
Paths
309-
end,
285+
lists:foldl(
286+
fun(E, Acc) ->
287+
[
288+
filelib:wildcard(
289+
Base ++ "/{lib,libs}/" ++ atom_to_list(E) ++ "*/**/{ebin,beams}"
290+
)
291+
| Acc
292+
]
293+
end,
294+
[],
295+
?LIBS
296+
),
310297
rebar_api:debug("AtomVM libraries to add to plt: ~p~n", [Libs]),
298+
NotFound = lists:duplicate(length(?LIBS), []),
311299
case Libs of
312-
[] ->
313-
rebar_api:abort("Unable to locate AtomVM beams in path", []);
300+
NotFound ->
301+
rebar_api:abort("Unable to locate AtomVM beams", []);
314302
Ebins ->
315303
Ebins
316304
end.

0 commit comments

Comments
 (0)