Browse Source

only pass current project state as state for project apps

pull/3/head
Tristan Sloughter 10 years ago
parent
commit
7425c4c612
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      src/rebar_prv_compile.erl

+ 13
- 1
src/rebar_prv_compile.erl View File

@ -38,16 +38,28 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
{ok, State1} = handle_args(State),
Jobs = rebar_state:get(State1, jobs),
ProjectApps = rebar_state:project_apps(State1),
Deps = rebar_state:get(State1, deps_to_build, []),
%% Need to allow global config vars used on deps
%% Right now no way to differeniate and just give deps a new state
lists:foreach(fun(AppInfo) ->
AppDir = rebar_app_info:dir(AppInfo),
C = rebar_config:consult(AppDir),
S = rebar_state:new(rebar_state:new(), C, AppDir),
S1 = rebar_state:set(S, jobs, Jobs),
build(S1, AppInfo)
end, Deps),
%% Use the project State for building project apps
lists:foreach(fun(AppInfo) ->
AppDir = rebar_app_info:dir(AppInfo),
C = rebar_config:consult(AppDir),
S = rebar_state:new(State1, C, AppDir),
build(S, AppInfo)
end, Deps++ProjectApps),
end, ProjectApps),
{ok, State1}.

Loading…
Cancel
Save