From 6fb49e7837a0c1dc3c2de38cb543219661b4054a Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Fri, 9 Oct 2020 22:21:09 +0000 Subject: [PATCH] discoverable edoc and escriptize --- src/rebar_prv_common_test.erl | 2 +- src/rebar_prv_edoc.erl | 1 + src/rebar_prv_escriptize.erl | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index fd437b3f..34ecfcd0 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -120,7 +120,7 @@ format_error({error_reading_testspec, Reason}) -> %% Internal functions %% =================================================================== -%% @doc Tries to make the symlink `_build//logs/last` to the `ct_run` directory +%% @doc Tries to make the symlink `_build//logs/last' to the `ct_run' directory %% of the last common test run. -spec symlink_to_last_ct_logs(rebar_state:t(), list()) -> ok. symlink_to_last_ct_logs(State, Opts) -> diff --git a/src/rebar_prv_edoc.erl b/src/rebar_prv_edoc.erl index 0c03f7bf..c7782d22 100644 --- a/src/rebar_prv_edoc.erl +++ b/src/rebar_prv_edoc.erl @@ -48,6 +48,7 @@ do(State) -> AppOpts = rebar_app_info:opts(AppInfo), %% order of the merge is important to allow app opts overrides AppEdocOpts = merge_opts(rebar_opts:get(AppOpts, edoc_opts, []), EdocOptsAcc), + ?DEBUG("{edoc_opts, ~p}.", [AppEdocOpts]), AppRes = (catch edoc:application(list_to_atom(AppName), AppDir, AppEdocOpts)), rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, AppInfo, State), case {AppRes, ShouldAccPaths} of diff --git a/src/rebar_prv_escriptize.erl b/src/rebar_prv_escriptize.erl index 9399a5bf..38976987 100644 --- a/src/rebar_prv_escriptize.erl +++ b/src/rebar_prv_escriptize.erl @@ -108,6 +108,7 @@ escriptize(State0, App) -> TopInclApps = lists:usort([ec_cnv:to_atom(AppName) | rebar_state:get(State, escript_incl_apps, [])]), AllApps = rebar_state:all_deps(State)++rebar_state:project_apps(State), InclApps = find_deps(TopInclApps, AllApps), + ?DEBUG("bundled applications:~n\t~p", [InclApps]), InclBeams = get_apps_beams(InclApps, AllApps), %% Look for a list of extra files to include in the output file. @@ -130,6 +131,8 @@ escriptize(State0, App) -> , {comment, def("%%", State, escript_comment, "%%\n")} , {emu_args, def("%%!", State, escript_emu_args, DefaultEmuArgs)} , {archive, Files, []} ], + ?DEBUG("escript options:", []), + [?DEBUG("\t{escript_~p, ~p}.", [K, V]) || {K, V} <- lists:droplast(EscriptSections)], case escript:create(Filename, EscriptSections) of ok -> ok; {error, EscriptError} -> @@ -249,7 +252,7 @@ find_deps(AppNames, AllApps) -> %% Should look at the app files to find direct dependencies find_deps_of_deps([], _, Acc) -> Acc; find_deps_of_deps([Name|Names], Apps, Acc) -> - ?DEBUG("processing ~p", [Name]), + ?DIAGNOSTIC("processing ~p", [Name]), {ok, App} = rebar_app_utils:find(Name, Apps), DepNames = proplists:get_value(applications, rebar_app_info:app_details(App), []), BinDepNames = [rebar_utils:to_binary(Dep) || Dep <- DepNames, @@ -258,7 +261,7 @@ find_deps_of_deps([Name|Names], Apps, Acc) -> DepDir =:= {error, bad_name} orelse % those are all local not lists:prefix(code:root_dir(), DepDir)] -- ([Name|Names]++Acc), % avoid already seen deps - ?DEBUG("new deps of ~p found to be ~p", [Name, BinDepNames]), + ?DIAGNOSTIC("new deps of ~p found to be ~p", [Name, BinDepNames]), find_deps_of_deps(BinDepNames ++ Names, Apps, BinDepNames ++ Acc). def(Rm, State, Key, Default) ->