From 7f508c30a1ece781f5dee552d3b5ae949947eb2f Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Thu, 5 Mar 2015 17:56:02 -0600 Subject: apply profiles and overrides for an app's opts to the base opts --- src/rebar_state.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/rebar_state.erl') diff --git a/src/rebar_state.erl b/src/rebar_state.erl index 8170b8d..6ca3baa 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -3,7 +3,7 @@ -export([new/0, new/1, new/2, new/3, get/2, get/3, set/3, - opts/1, + opts/1, opts/2, default/1, default/2, escript_path/1, escript_path/2, @@ -37,7 +37,6 @@ -record(state_t, {dir :: file:name(), opts = dict:new() :: rebar_dict(), default = dict:new() :: rebar_dict(), - escript_path :: undefined | file:filename_all(), lock = [], @@ -129,6 +128,9 @@ default(State, Opts) -> opts(#state_t{opts=Opts}) -> Opts. +opts(State, Opts) -> + State#state_t{opts=Opts}. + current_profiles(#state_t{current_profiles=Profiles}) -> Profiles. -- cgit v1.1 From 0638c85634f3f9f51f17f247a3376f72b2f4d2fa Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 6 Mar 2015 08:59:10 -0600 Subject: store base opts after initialization of providers --- src/rebar_state.erl | 1 + 1 file changed, 1 insertion(+) (limited to 'src/rebar_state.erl') diff --git a/src/rebar_state.erl b/src/rebar_state.erl index 6ca3baa..e77a259 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -96,6 +96,7 @@ new(ParentState, Config, Dir) -> D = proplists:get_value(deps, Config, []), dict:from_list([{{deps, default}, D} | Config]) end, + NewOpts = dict:merge(fun(_Key, Value1, _Value2) -> Value1 end, LocalOpts, Opts), -- cgit v1.1