浏览代码

update plugin install code

pull/77/head
Tristan Sloughter 10 年前
父节点
当前提交
91d297cf8a
共有 3 个文件被更改,包括 7 次插入4 次删除
  1. +0
    -1
      src/rebar3.erl
  2. +3
    -2
      src/rebar_plugins.erl
  3. +4
    -1
      src/rebar_prv_install_deps.erl

+ 0
- 1
src/rebar3.erl 查看文件

@ -122,7 +122,6 @@ run_aux(State, GlobalPluginProviders, RawArgs) ->
{ok, Providers} = application:get_env(rebar, providers),
{ok, PluginProviders, State4} = rebar_plugins:install(State3),
rebar_core:update_code_path(State4),
AllProviders = Providers++PluginProviders++GlobalPluginProviders,
State5 = rebar_state:create_logic_providers(AllProviders, State4),
{Task, Args} = parse_args(RawArgs),

+ 3
- 2
src/rebar_plugins.erl 查看文件

@ -28,7 +28,8 @@ install(State) ->
-spec handle_plugin(rebar_prv_install_deps:dep(), rebar_state:t()) -> {true, any()} | false.
handle_plugin(Plugin, State) ->
try
{ok, _, State1} = rebar_prv_install_deps:handle_deps(State, [Plugin]),
{ok, _, State1} = rebar_prv_install_deps:handle_deps(default, State, [Plugin]),
Apps = rebar_state:all_deps(State1),
ToBuild = lists:dropwhile(fun rebar_app_info:valid/1, Apps),
lists:foreach(fun(AppInfo) ->
@ -55,7 +56,7 @@ plugin_providers(Plugin) when is_atom(Plugin) ->
validate_plugin(Plugin).
validate_plugin(Plugin) ->
application:load(Plugin),
ok = application:load(Plugin),
case application:get_env(Plugin, providers) of
{ok, Providers} ->
{true, Providers};

+ 4
- 1
src/rebar_prv_install_deps.erl 查看文件

@ -357,7 +357,7 @@ maybe_fetch(AppInfo, Update, Seen) ->
-spec parse_deps(binary(), list()) -> {[rebar_app_info:t()], [pkg_dep()]}.
parse_deps(DepsDir, Deps) ->
lists:foldl(fun({Name, Vsn}, {SrcDepsAcc, PkgDepsAcc}) ->
lists:foldl(fun({Name, Vsn}, {SrcDepsAcc, PkgDepsAcc}) when is_list(Vsn) ->
{SrcDepsAcc, [parse_goal(ec_cnv:to_binary(Name)
,ec_cnv:to_binary(Vsn)) | PkgDepsAcc]};
(Name, {SrcDepsAcc, PkgDepsAcc}) when is_atom(Name) ->
@ -365,6 +365,9 @@ parse_deps(DepsDir, Deps) ->
({Name, Source}, {SrcDepsAcc, PkgDepsAcc}) when is_tuple (Source) ->
Dep = new_dep(DepsDir, Name, [], Source),
{[Dep | SrcDepsAcc], PkgDepsAcc};
({Name, Source}, {SrcDepsAcc, PkgDepsAcc}) when is_tuple (Source) ->
Dep = new_dep(DepsDir, Name, [], Source),
{[Dep | SrcDepsAcc], PkgDepsAcc};
({Name, _Vsn, Source}, {SrcDepsAcc, PkgDepsAcc}) when is_tuple (Source) ->
Dep = new_dep(DepsDir, Name, [], Source),
{[Dep | SrcDepsAcc], PkgDepsAcc};

正在加载...
取消
保存