diff options
author | Tristan Sloughter <t@crashfast.com> | 2014-11-01 16:54:33 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2014-11-01 16:54:33 -0500 |
commit | 7425c4c61279dde438eb79e0ba67222976e413fa (patch) | |
tree | bae439ac627421f5234743f42ae4da544c93dfce | |
parent | fd59279edc07bbfa30ee76d6d00c2731ebb0a573 (diff) |
only pass current project state as state for project apps
-rw-r--r-- | src/rebar_prv_compile.erl | 14 |
1 files changed, 13 insertions, 1 deletions
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}. |