diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/rebar.app.src | 2 | ||||
-rw-r--r-- | src/rebar3.erl | 5 | ||||
-rw-r--r-- | src/rebar_plugins.erl | 9 | ||||
-rw-r--r-- | src/rebar_prv_shell.erl | 18 |
5 files changed, 21 insertions, 15 deletions
@@ -13,7 +13,7 @@ configuration work. rebar also provides dependency management, enabling application writers to easily re-use common libraries from a variety of locations (git, hg, etc). -3.0 Alpha-5 +3.0 Alpha-6 ==== [DOCUMENTATION](http://www.rebar3.org/v3.0/docs) diff --git a/src/rebar.app.src b/src/rebar.app.src index f753784..e9f0677 100644 --- a/src/rebar.app.src +++ b/src/rebar.app.src @@ -3,7 +3,7 @@ {application, rebar, [{description, "Rebar: Erlang Build Tool"}, - {vsn, "3.0.0-alpha-5"}, + {vsn, "3.0.0-alpha-6"}, {modules, []}, {registered, []}, {applications, [kernel, diff --git a/src/rebar3.erl b/src/rebar3.erl index 5321278..4e90d82 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -98,10 +98,9 @@ run_aux(State, RawArgs) -> filename:join(filename:absname(rebar_state:dir(State2)), BaseDir)), {ok, Providers} = application:get_env(rebar, providers), - State4 = rebar_plugins:install(State3), - %% Providers can modify profiles stored in opts, so set default after initializing providers - State5 = rebar_state:create_logic_providers(Providers, State4), + State4 = rebar_state:create_logic_providers(Providers, State3), + State5 = rebar_plugins:install(State4), State6 = rebar_state:default(State5, rebar_state:opts(State5)), {Task, Args} = parse_args(RawArgs), diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl index c4644dc..88cb8b8 100644 --- a/src/rebar_plugins.erl +++ b/src/rebar_plugins.erl @@ -60,7 +60,7 @@ handle_plugin(Profile, Plugin, State) -> code:add_pathsa(CodePaths), %% Build plugin and its deps - [build_plugin(AppInfo) || AppInfo <- ToBuild], + [build_plugin(AppInfo, Apps, State) || AppInfo <- ToBuild], %% Add newly built deps and plugin to code path State3 = rebar_state:update_all_plugin_deps(State2, Apps), @@ -78,11 +78,12 @@ handle_plugin(Profile, Plugin, State) -> {[], State} end. -build_plugin(AppInfo) -> +build_plugin(AppInfo, Apps, State) -> + Providers = rebar_state:providers(State), AppDir = rebar_app_info:dir(AppInfo), C = rebar_config:consult(AppDir), - S = rebar_state:new(rebar_state:new(), C, AppDir), - rebar_prv_compile:compile(S, [], AppInfo). + S = rebar_state:new(rebar_state:all_deps(rebar_state:new(), Apps), C, AppDir), + rebar_prv_compile:compile(S, Providers, AppInfo). plugin_providers({Plugin, _, _, _}) when is_atom(Plugin) -> validate_plugin(Plugin); diff --git a/src/rebar_prv_shell.erl b/src/rebar_prv_shell.erl index bd49ee1..e407ff2 100644 --- a/src/rebar_prv_shell.erl +++ b/src/rebar_prv_shell.erl @@ -111,12 +111,18 @@ setup_shell() -> %% liveness check. _ = [catch erlang:group_leader(whereis(user), Pid) || Pid <- NeedsUpdate, is_process_alive(Pid)], - %% enable error_logger's tty output - ok = error_logger:swap_handler(tty), - %% disable the simple error_logger (which may have been added multiple - %% times). removes at most the error_logger added by init and the - %% error_logger added by the tty handler - ok = remove_error_handler(3). + try + %% enable error_logger's tty output + error_logger:swap_handler(tty), + %% disable the simple error_logger (which may have been added multiple + %% times). removes at most the error_logger added by init and the + %% error_logger added by the tty handler + remove_error_handler(3) + catch + E:R -> % may fail with custom loggers + ?DEBUG("Logger changes failed for ~p:~p (~p)", [E,R,erlang:get_stacktrace()]), + hope_for_best + end. setup_paths(State) -> %% Add deps to path |