summaryrefslogtreecommitdiff
path: root/src/rebar3.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-04-05 10:23:43 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-04-05 10:23:43 -0400
commit3250faa75683bdbfc521c4e8c6772f45d6d2e863 (patch)
tree869b863aff8062d78042d27ef62f9236c3a4559f /src/rebar3.erl
parenta99344a47066dd26b02cf34e84c15aa2f6f4dbe5 (diff)
parent79e2d6006c989a241d4599d048ff39f094f9e886 (diff)
Merge pull request #320 from tsloughter/dep_plugins
install dep plugins & run provider hooks the same as shell hooks (Rereopen 316)
Diffstat (limited to 'src/rebar3.erl')
-rw-r--r--src/rebar3.erl24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index 87258aa..461206d 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -77,7 +77,7 @@ run(BaseState, Commands) ->
_ = application:load(rebar),
BaseState1 = rebar_state:set(BaseState, task, Commands),
BaseState2 = rebar_state:set(BaseState1, caller, api),
- run_aux(BaseState2, [], Commands).
+ run_aux(BaseState2, Commands).
%% ====================================================================
%% Internal functions
@@ -86,7 +86,7 @@ run(BaseState, Commands) ->
run(RawArgs) ->
_ = application:load(rebar),
- {GlobalPluginProviders, BaseState} = init_config(),
+ BaseState = init_config(),
BaseState1 = rebar_state:set(BaseState, caller, command_line),
case erlang:system_info(version) of
@@ -98,9 +98,9 @@ run(RawArgs) ->
end,
{BaseState2, _Args1} = set_options(BaseState1, {[], []}),
- run_aux(BaseState2, GlobalPluginProviders, RawArgs).
+ run_aux(BaseState2, RawArgs).
-run_aux(State, GlobalPluginProviders, RawArgs) ->
+run_aux(State, RawArgs) ->
%% Make sure crypto is running
case crypto:start() of
ok -> ok;
@@ -124,16 +124,17 @@ run_aux(State, GlobalPluginProviders, RawArgs) ->
filename:join(filename:absname(rebar_state:dir(State2)), BaseDir)),
{ok, Providers} = application:get_env(rebar, providers),
- {ok, PluginProviders, State4} = rebar_plugins:install(State3),
+ {ok, Resources} = application:get_env(rebar, resources),
+ State4 = rebar_state:resources(State3, Resources),
+ State5 = rebar_plugins:install(State4),
%% Providers can modify profiles stored in opts, so set default after initializing providers
- AllProviders = Providers++PluginProviders++GlobalPluginProviders,
- State5 = rebar_state:create_logic_providers(AllProviders, State4),
- State6 = rebar_state:default(State5, rebar_state:opts(State5)),
+ State6 = rebar_state:create_logic_providers(Providers, State5),
+ State7 = rebar_state:default(State6, rebar_state:opts(State6)),
{Task, Args} = parse_args(RawArgs),
- rebar_core:init_command(rebar_state:command_args(State6, Args), Task).
+ rebar_core:init_command(rebar_state:command_args(State7, Args), Task).
init_config() ->
%% Initialize logging system
@@ -156,10 +157,9 @@ init_config() ->
?DEBUG("Load global config file ~p",
[GlobalConfigFile]),
GlobalConfig = rebar_state:new(global, rebar_config:consult_file(GlobalConfigFile)),
- {ok, PluginProviders, GlobalConfig1} = rebar_plugins:install(GlobalConfig),
+ GlobalConfig1 = rebar_plugins:install(GlobalConfig),
rebar_state:new(GlobalConfig1, Config1);
false ->
- PluginProviders = [],
rebar_state:new(Config1)
end,
@@ -175,7 +175,7 @@ init_config() ->
%% TODO: Do we need this still? I think it may still be used.
%% Initialize vsn cache
- {PluginProviders, rebar_state:set(State1, vsn_cache, dict:new())}.
+ rebar_state:set(State1, vsn_cache, dict:new()).
parse_args([]) ->
parse_args(["help"]);