summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-11-01 16:54:33 -0500
committerTristan Sloughter <t@crashfast.com>2014-11-01 16:54:33 -0500
commit7425c4c61279dde438eb79e0ba67222976e413fa (patch)
treebae439ac627421f5234743f42ae4da544c93dfce
parentfd59279edc07bbfa30ee76d6d00c2731ebb0a573 (diff)
only pass current project state as state for project apps
-rw-r--r--src/rebar_prv_compile.erl14
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}.