summaryrefslogtreecommitdiff
path: root/src/rebar3.erl
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2015-08-21 21:23:08 -0500
committerTristan Sloughter <tristan.sloughter@gmail.com>2015-08-21 21:23:08 -0500
commit1f6516b231260a1b2e48f9b86e37a5d317d4983c (patch)
treefdade8897340406cf52bd7807e92086856f13a60 /src/rebar3.erl
parentb52395f4aec11bacaace91ec72e100c9778d6098 (diff)
parente853e12d7c5b3f0f29670d4ae89d17d004edada1 (diff)
Merge pull request #732 from tsloughter/level_wins
this patch treats pkg and src deps as equals, so level decides winner
Diffstat (limited to 'src/rebar3.erl')
-rw-r--r--src/rebar3.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index 8004443..ab3e0eb 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -105,6 +105,7 @@ run_aux(State, RawArgs) ->
{ok, Providers} = application:get_env(rebar, providers),
%% Providers can modify profiles stored in opts, so set default after initializing providers
State4 = rebar_state:create_logic_providers(Providers, State3),
+ rebar_packages:packages(State4),
State5 = rebar_plugins:project_apps_install(State4),
State6 = rebar_state:default(State5, rebar_state:opts(State5)),
@@ -280,9 +281,15 @@ state_from_global_config(Config, GlobalConfigFile) ->
%% We don't want to worry about global plugin install state effecting later
%% usage. So we throw away the global profile state used for plugin install.
GlobalConfigThrowAway = rebar_state:current_profiles(GlobalConfig, [global]),
- GlobalState = rebar_plugins:handle_plugins(global,
- rebar_state:get(GlobalConfigThrowAway, plugins, []),
- GlobalConfigThrowAway),
+ GlobalState = case rebar_state:get(GlobalConfigThrowAway, plugins, []) of
+ [] ->
+ GlobalConfigThrowAway;
+ GlobalPluginsToInstall ->
+ rebar_packages:packages(GlobalConfigThrowAway),
+ rebar_plugins:handle_plugins(global,
+ GlobalPluginsToInstall,
+ GlobalConfigThrowAway)
+ end,
GlobalPlugins = rebar_state:providers(GlobalState),
GlobalConfig2 = rebar_state:set(GlobalConfig, plugins, []),
GlobalConfig3 = rebar_state:set(GlobalConfig2, {plugins, global}, rebar_state:get(GlobalConfigThrowAway, plugins, [])),