From 7425c4c61279dde438eb79e0ba67222976e413fa Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 1 Nov 2014 16:54:33 -0500 Subject: only pass current project state as state for project apps --- src/rebar_prv_compile.erl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl index 30611cd..c87d5d8 100644 --- a/src/rebar_prv_compile.erl +++ b/src/rebar_prv_compile.erl @@ -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}. -- cgit v1.1