From ae8298203952dd631e573668ccd5eb6655538c46 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 21 Nov 2012 10:07:40 -0500 Subject: minor cleanup and refactoring for rcl_prv_assembler, rcl_prv_discover Signed-off-by: Jordan Wilberding --- src/rcl_prv_assembler.erl | 2 -- src/rcl_prv_discover.erl | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/rcl_prv_assembler.erl b/src/rcl_prv_assembler.erl index a118b12..59d9946 100644 --- a/src/rcl_prv_assembler.erl +++ b/src/rcl_prv_assembler.erl @@ -73,8 +73,6 @@ format_error({release_script_generation_error, Module, Errors}) -> ["Errors generating release \n", rcl_util:indent(1), Module:format_error(Errors)]. - - %%%=================================================================== %%% Internal Functions %%%=================================================================== diff --git a/src/rcl_prv_discover.erl b/src/rcl_prv_discover.erl index 23a3937..82f138b 100644 --- a/src/rcl_prv_discover.erl +++ b/src/rcl_prv_discover.erl @@ -49,7 +49,17 @@ do(State) -> ["Resolving OTP Applications from directories:\n", [[rcl_util:indent(1), LibDir, "\n"] || LibDir <- LibDirs]] end), + resolve_app_metadata(State, LibDirs, OutputDir). +-spec format_error([ErrorDetail::term()]) -> iolist(). +format_error(ErrorDetails) + when erlang:is_list(ErrorDetails) -> + [[format_detail(ErrorDetail), "\n"] || ErrorDetail <- ErrorDetails]. + +%%%=================================================================== +%%% Internal Functions +%%%=================================================================== +resolve_app_metadata(State, LibDirs, OutputDir) -> AppMeta0 = lists:flatten(ec_plists:map(fun(LibDir) -> discover_dir([OutputDir], LibDir) @@ -66,9 +76,6 @@ do(State) -> false end], - lists:filter(fun({error, _}) -> true; - (_) -> false - end, AppMeta0), case Errors of [] -> AppMeta1 = lists:flatten(AppMeta0), @@ -82,14 +89,7 @@ do(State) -> ?RCL_ERROR(Errors) end. --spec format_error([ErrorDetail::term()]) -> iolist(). -format_error(ErrorDetails) - when erlang:is_list(ErrorDetails) -> - [[format_detail(ErrorDetail), "\n"] || ErrorDetail <- ErrorDetails]. -%%%=================================================================== -%%% Internal Functions -%%%=================================================================== get_lib_dirs(State) -> LibDirs0 = rcl_state:lib_dirs(State), add_rebar_deps_dir(State, LibDirs0). -- cgit v1.2.3