Skip to content

Commit

Permalink
add env var for skipping project plugins
Browse files Browse the repository at this point in the history
tools like mix and gleam only use rebar3 to compile deps and thus
don't wnat project_plugins. They can now set this to skip
installing those.

I originally was going to check if `bare` was the task but there
are too many ways that might be run without being the first
command (like rebar3 as prod bare compile) that I figured this
was better.
  • Loading branch information
tsloughter committed Dec 26, 2024
1 parent 1dbce09 commit 1d0a82f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/rebar/src/rebar3.erl
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,15 @@ run_aux(State, RawArgs) ->
{ok, Providers} = application:get_env(rebar, providers),
%% Providers can modify profiles stored in opts, so set default after initializing providers
State6 = rebar_state:create_logic_providers(Providers, State5),
%% Initializing project_plugins which can override default providers
State7 = rebar_plugins:project_plugins_install(State6),

State7 = case os:getenv("REBAR_SKIP_PROJECT_PLUGINS") of
false ->
%% Initializing project_plugins which can override default providers
rebar_plugins:project_plugins_install(State6);
_ ->
State6
end,

State8 = rebar_plugins:top_level_install(State7),

State9 = rebar_state:default(State8, rebar_state:opts(State8)),
Expand Down

0 comments on commit 1d0a82f

Please sign in to comment.