浏览代码

Some post-review changes:

- restore path after loading applications,
- helpful comments.
pull/1348/head
Alexander Sedov 8 年前
父节点
当前提交
e71b80752f
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. +4
    -0
      src/rebar_prv_common_test.erl
  2. +2
    -0
      src/rebar_utils.erl

+ 4
- 0
src/rebar_prv_common_test.erl 查看文件

@ -221,9 +221,13 @@ select_tests(State, ProjectApps, CmdOpts, CfgOpts) ->
Configs = lists:flatmap(fun(Filename) ->
rebar_file_utils:consult_config(State, Filename)
end, SysConfigs),
%% NB: load the applications (from user directories too) to support OTP < 17
%% to our best ability.
OldPath = code:get_path(),
code:add_pathsa(rebar_state:code_paths(State, all_deps)),
[application:load(Application) || Config <- Configs, {Application, _} <- Config],
rebar_utils:reread_config(Configs),
code:set_path(OldPath),
Merged = lists:ukeymerge(1,
lists:ukeysort(1, CmdOpts),

+ 2
- 0
src/rebar_utils.erl 查看文件

@ -414,6 +414,8 @@ user_agent() ->
?FMT("Rebar/~s (OTP/~s)", [Vsn, otp_release()]).
reread_config(ConfigList) ->
%% NB: we attempt to mimic -config here, which survives app reload,
%% hence {persistent, true}.
SetEnv = case version_tuple(?MODULE:otp_release()) of
{X, _, _} when X =< 17 ->
fun application:set_env/3;

正在加载...
取消
保存