Bläddra i källkod

move deps_to_build out of config dict of state

pull/31/head
Tristan Sloughter 10 år sedan
förälder
incheckning
fa71d55b0d
3 ändrade filer med 14 tillägg och 3 borttagningar
  1. +1
    -1
      src/rebar_prv_compile.erl
  2. +3
    -2
      src/rebar_prv_install_deps.erl
  3. +10
    -0
      src/rebar_state.erl

+ 1
- 1
src/rebar_prv_compile.erl Visa fil

@ -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),

+ 3
- 2
src/rebar_prv_install_deps.erl Visa fil

@ -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

+ 10
- 0
src/rebar_state.erl Visa fil

@ -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.

Laddar…
Avbryt
Spara