Browse Source

don't lose defualt deps when creating current profile

pull/46/head
Tristan Sloughter 10 years ago
parent
commit
f77cbb7f50
3 changed files with 8 additions and 1 deletions
  1. +2
    -0
      src/rebar_prv_install_deps.erl
  2. +1
    -1
      src/rebar_prv_tar.erl
  3. +5
    -0
      src/rebar_state.erl

+ 2
- 0
src/rebar_prv_install_deps.erl View File

@ -70,6 +70,8 @@ do(State) ->
ProjectApps = rebar_state:project_apps(State), ProjectApps = rebar_state:project_apps(State),
try try
{ok, SrcApps, State1} = case {Profile, rebar_state:get(State, locks, [])} of {ok, SrcApps, State1} = case {Profile, rebar_state:get(State, locks, [])} of
{default, []} ->
handle_deps(State, rebar_state:get(State, {deps, Profile}, []));
{default, Locks} -> {default, Locks} ->
handle_deps(State, Locks); handle_deps(State, Locks);
_ -> _ ->

+ 1
- 1
src/rebar_prv_tar.erl View File

@ -12,7 +12,7 @@
-include("rebar.hrl"). -include("rebar.hrl").
-define(PROVIDER, tar). -define(PROVIDER, tar).
-define(DEPS, [compile]).
-define(DEPS, [{compile, default}, compile]).
%% =================================================================== %% ===================================================================
%% Public API %% Public API

+ 5
- 0
src/rebar_state.erl View File

@ -152,6 +152,10 @@ command_parsed_args(State, CmdArgs) ->
State#state_t{command_parsed_args=CmdArgs}. State#state_t{command_parsed_args=CmdArgs}.
%% Only apply profiles to the default profile %% Only apply profiles to the default profile
apply_profile(State=#state_t{default=Opts}, default) ->
Deps = rebar_state:get(State, deps, []),
Opts1 = dict:store({deps, default}, Deps, Opts),
State#state_t{opts=Opts1};
apply_profile(State=#state_t{default=Opts}, Profile) -> apply_profile(State=#state_t{default=Opts}, Profile) ->
ConfigProfiles = rebar_state:get(State, profiles, []), ConfigProfiles = rebar_state:get(State, profiles, []),
Deps = rebar_state:get(State, deps, []), Deps = rebar_state:get(State, deps, []),
@ -172,6 +176,7 @@ merge_opts(Profile, NewOpts, OldOpts) ->
(_Key, NewValue, _OldValue) -> (_Key, NewValue, _OldValue) ->
NewValue NewValue
end, NewOpts, OldOpts), end, NewOpts, OldOpts),
case dict:find(deps, NewOpts) of case dict:find(deps, NewOpts) of
error -> error ->
dict:store({deps, Profile}, [], Dict); dict:store({deps, Profile}, [], Dict);

Loading…
Cancel
Save