diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-03 07:32:57 -0600 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-03 07:32:57 -0600 |
commit | 358046b0957fc7211f5dab7d76f0bc365d00c439 (patch) | |
tree | f13157852e061f5184ce9727dd6051d1a85e56d9 /src/rebar_state.erl | |
parent | 4c70d16e505c05695e902bea502855d8383fbe82 (diff) | |
parent | 6c421e543373aaf41a6ed10719f5da19b0cafd93 (diff) |
Merge pull request #202 from talentdeficit/cover
`cover` task
Diffstat (limited to 'src/rebar_state.erl')
-rw-r--r-- | src/rebar_state.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl index 39e0e88..8170b8d 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -15,7 +15,7 @@ command_args/1, command_args/2, command_parsed_args/1, command_parsed_args/2, - apply_profiles/2, + add_to_profile/3, apply_profiles/2, dir/1, dir/2, create_logic_providers/2, @@ -97,7 +97,6 @@ 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), @@ -188,6 +187,13 @@ apply_overrides(State=#state_t{overrides=Overrides}, AppName) -> StateAcc end, State2, Overrides). +add_to_profile(State, Profile, KVs) when is_atom(Profile), is_list(KVs) -> + Profiles = rebar_state:get(State, profiles, []), + ProfileOpts = dict:from_list(proplists:get_value(Profile, Profiles, [])), + NewOpts = merge_opts(Profile, dict:from_list(KVs), ProfileOpts), + NewProfiles = [{Profile, dict:to_list(NewOpts)}|lists:keydelete(Profile, 1, Profiles)], + rebar_state:set(State, profiles, NewProfiles). + apply_profiles(State, Profile) when not is_list(Profile) -> apply_profiles(State, [Profile]); apply_profiles(State, [default]) -> |