From fa71d55b0d41312968af0374c9adea27879ce04e Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Mon, 1 Dec 2014 11:40:51 -0600 Subject: move deps_to_build out of config dict of state --- src/rebar_prv_compile.erl | 2 +- src/rebar_prv_install_deps.erl | 5 +++-- src/rebar_state.erl | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl index 893fd76..60737d1 100644 --- a/src/rebar_prv_compile.erl +++ b/src/rebar_prv_compile.erl @@ -42,7 +42,7 @@ do(State) -> Jobs = rebar_state:get(State1, jobs), ProjectApps = rebar_state:project_apps(State1), - Deps = rebar_state:get(State1, deps_to_build, []), + Deps = rebar_state:deps_to_build(State1), Cwd = rebar_utils:get_cwd(), rebar_hooks:run_compile_hooks(Cwd, pre_hooks, compile, State1), diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index d5f4b69..68a0e21 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -78,8 +78,9 @@ do(State) -> Source = ProjectApps ++ SrcApps, case rebar_digraph:compile_order(Source) of {ok, Sort} -> - {ok, rebar_state:set(State1, deps_to_build, - lists:dropwhile(fun rebar_app_info:valid/1, Sort -- ProjectApps))}; + {ok, rebar_state:deps_to_build(State1, + lists:dropwhile(fun rebar_app_info:valid/1 + , Sort -- ProjectApps))}; {error, Error} -> {error, Error} end diff --git a/src/rebar_state.erl b/src/rebar_state.erl index a59968e..3350ffe 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -20,6 +20,7 @@ create_logic_providers/2, project_apps/1, project_apps/2, + deps_to_build/1, deps_to_build/2, all_deps/1, all_deps/2, deps_names/1, @@ -40,6 +41,7 @@ command_parsed_args = [], project_apps = [] :: [rebar_app_into:t()], + deps_to_build = [] :: [rebar_app_into:t()], all_deps = [] :: [rebar_app_into:t()], providers = []}). @@ -188,6 +190,14 @@ project_apps(State=#state_t{}, NewApps) when is_list(NewApps) -> project_apps(State=#state_t{project_apps=Apps}, App) -> State#state_t{project_apps=lists:keystore(rebar_app_info:name(App), 2, Apps, App)}. +deps_to_build(#state_t{deps_to_build=Apps}) -> + Apps. + +deps_to_build(State=#state_t{}, NewApps) when is_list(NewApps) -> + State#state_t{deps_to_build=NewApps}; +deps_to_build(State=#state_t{deps_to_build=Apps}, App) -> + State#state_t{deps_to_build=lists:keystore(rebar_app_info:name(App), 2, Apps, App)}. + all_deps(#state_t{all_deps=Apps}) -> Apps. -- cgit v1.1