瀏覽代碼

discoverable edoc and escriptize

pull/2393/head
Fred Hebert 4 年之前
父節點
當前提交
6fb49e7837
共有 3 個文件被更改,包括 7 次插入3 次删除
  1. +1
    -1
      src/rebar_prv_common_test.erl
  2. +1
    -0
      src/rebar_prv_edoc.erl
  3. +5
    -2
      src/rebar_prv_escriptize.erl

+ 1
- 1
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/<profile>/logs/last` to the `ct_run` directory
%% @doc Tries to make the symlink `_build/<profile>/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) ->

+ 1
- 0
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

+ 5
- 2
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) ->

Loading…
取消
儲存