Procházet zdrojové kódy

Merge pull request #407 from tsloughter/plugins2

add all plugins, not those just built, to path
pull/408/head
Fred Hebert před 10 roky
rodič
revize
b904c5b57a
2 změnil soubory, kde provedl 7 přidání a 3 odebrání
  1. +5
    -1
      src/rebar_api.erl
  2. +2
    -2
      src/rebar_plugins.erl

+ 5
- 1
src/rebar_api.erl Zobrazit soubor

@ -10,7 +10,8 @@
get_arch/0,
wordsize/0,
add_deps_to_path/1,
restore_code_path/1]).
restore_code_path/1,
processing_base_dir/1]).
-export_type([rebar_dict/0, rebar_digraph/0]).
@ -59,3 +60,6 @@ add_deps_to_path(State) ->
%% Revert to only having the beams necessary for running rebar3 and plugins in the path
restore_code_path(State) ->
rebar_utils:cleanup_code_path(rebar_state:code_paths(State, default)).
processing_base_dir(State) ->
rebar_dir:processing_base_dir(State).

+ 2
- 2
src/rebar_plugins.erl Zobrazit soubor

@ -42,6 +42,7 @@ handle_plugin(Plugin, State) ->
Apps = rebar_state:all_deps(State2),
ToBuild = lists:dropwhile(fun rebar_app_info:valid/1, Apps),
[build_plugin(AppInfo) || AppInfo <- ToBuild],
[true = code:add_patha(filename:join(rebar_app_info:dir(AppInfo), "ebin")) || AppInfo <- Apps],
plugin_providers(Plugin)
catch
C:T ->
@ -54,8 +55,7 @@ build_plugin(AppInfo) ->
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),
true = code:add_patha(filename:join(AppDir, "ebin")).
rebar_prv_compile:compile(S, AppInfo).
plugin_providers({Plugin, _, _}) when is_atom(Plugin) ->
validate_plugin(Plugin);

Načítá se…
Zrušit
Uložit