From f77cbb7f508345c1352b957d75e0e350725f707c Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 6 Dec 2014 17:47:41 -0600 Subject: don't lose defualt deps when creating current profile --- src/rebar_prv_install_deps.erl | 2 ++ src/rebar_prv_tar.erl | 2 +- src/rebar_state.erl | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index 692beaf..20e7808 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -70,6 +70,8 @@ do(State) -> ProjectApps = rebar_state:project_apps(State), try {ok, SrcApps, State1} = case {Profile, rebar_state:get(State, locks, [])} of + {default, []} -> + handle_deps(State, rebar_state:get(State, {deps, Profile}, [])); {default, Locks} -> handle_deps(State, Locks); _ -> diff --git a/src/rebar_prv_tar.erl b/src/rebar_prv_tar.erl index 40a84e3..0225e19 100644 --- a/src/rebar_prv_tar.erl +++ b/src/rebar_prv_tar.erl @@ -12,7 +12,7 @@ -include("rebar.hrl"). -define(PROVIDER, tar). --define(DEPS, [compile]). +-define(DEPS, [{compile, default}, compile]). %% =================================================================== %% Public API diff --git a/src/rebar_state.erl b/src/rebar_state.erl index 7cdfd9a..b412c27 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -152,6 +152,10 @@ command_parsed_args(State, CmdArgs) -> State#state_t{command_parsed_args=CmdArgs}. %% 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) -> ConfigProfiles = rebar_state:get(State, profiles, []), Deps = rebar_state:get(State, deps, []), @@ -172,6 +176,7 @@ merge_opts(Profile, NewOpts, OldOpts) -> (_Key, NewValue, _OldValue) -> NewValue end, NewOpts, OldOpts), + case dict:find(deps, NewOpts) of error -> dict:store({deps, Profile}, [], Dict); -- cgit v1.1