From f2f63013fedbde4ea1de0ae09d767eb92eb1a5d2 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sun, 23 Aug 2015 14:23:58 -0500 Subject: override 'deps' now automatically overrides '{deps,default}' --- src/rebar_state.erl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rebar_state.erl b/src/rebar_state.erl index f365293..6feae81 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -242,7 +242,9 @@ apply_overrides(State=#state_t{overrides=Overrides}, AppName) -> %% Inefficient. We want the order we get here though. State1 = lists:foldl(fun({override, O}, StateAcc) -> - lists:foldl(fun({Key, Value}, StateAcc1) -> + lists:foldl(fun({deps, Value}, StateAcc1) -> + rebar_state:set(StateAcc1, {deps,default}, Value); + ({Key, Value}, StateAcc1) -> rebar_state:set(StateAcc1, Key, Value) end, StateAcc, O); (_, StateAcc) -> @@ -250,7 +252,9 @@ apply_overrides(State=#state_t{overrides=Overrides}, AppName) -> end, State, Overrides), State2 = lists:foldl(fun({override, N, O}, StateAcc) when N =:= Name -> - lists:foldl(fun({Key, Value}, StateAcc1) -> + lists:foldl(fun({deps, Value}, StateAcc1) -> + rebar_state:set(StateAcc1, {deps,default}, Value); + ({Key, Value}, StateAcc1) -> rebar_state:set(StateAcc1, Key, Value) end, StateAcc, O); (_, StateAcc) -> @@ -258,7 +262,10 @@ apply_overrides(State=#state_t{overrides=Overrides}, AppName) -> end, State1, Overrides), State3 = lists:foldl(fun({add, N, O}, StateAcc) when N =:= Name -> - lists:foldl(fun({Key, Value}, StateAcc1) -> + lists:foldl(fun({deps, Value}, StateAcc1) -> + OldValue = rebar_state:get(StateAcc1, {deps,default}, []), + rebar_state:set(StateAcc1, {deps,default}, Value++OldValue); + ({Key, Value}, StateAcc1) -> OldValue = rebar_state:get(StateAcc1, Key, []), rebar_state:set(StateAcc1, Key, Value++OldValue) end, StateAcc, O); -- cgit v1.1