diff options
author | Tristan Sloughter <t@crashfast.com> | 2014-12-24 11:30:59 -0600 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2014-12-24 13:06:20 -0600 |
commit | 91d297cf8ac59849137d360b58c1dcd1a719e4a9 (patch) | |
tree | 39f1946db83a747492dfa1009fbadef459026fae | |
parent | faeb3d3989d47fb8680fdef3a598ebc4fae62f65 (diff) |
update plugin install code
-rw-r--r-- | src/rebar3.erl | 1 | ||||
-rw-r--r-- | src/rebar_plugins.erl | 5 | ||||
-rw-r--r-- | src/rebar_prv_install_deps.erl | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index d4307f7..f69d27f 100644 --- a/src/rebar3.erl +++ b/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), diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl index e1f529d..45cb5c9 100644 --- a/src/rebar_plugins.erl +++ b/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}; diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index 0ebc1cd..9561d8e 100644 --- a/src/rebar_prv_install_deps.erl +++ b/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}; |