Skip to content

Commit

Permalink
add comment on why plugins list uses checkouts_dir not checkouts_out_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter committed May 1, 2020
1 parent 1f9dfd8 commit 2101783
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rebar.config.sample
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@
{root_dir, "."}.
%% where checkout dependencies are to be located
{checkouts_dir, "_checkouts"}.
%% where, under <base_dir>/<profile> checkout dependencies are to be built
{checkouts_out_dir, "checkouts"}.
%% directory in '<base_dir>/<profile>/' where plugins go
{plugins_dir, "plugins"}.
%% directories where OTP applications for the project can be located
Expand Down
2 changes: 2 additions & 0 deletions src/rebar_env.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
%% REBAR_BUILD_DIR = rebar_dir:base_dir/1
%% REBAR_ROOT_DIR = rebar_dir:root_dir/1
%% REBAR_CHECKOUTS_DIR = rebar_dir:checkouts_dir/1
%% REBAR_CHECKOUTS_OUT_DIR = rebar_dir:checkouts_out_dir/1
%% REBAR_PLUGINS_DIR = rebar_dir:plugins_dir/1
%% REBAR_GLOBAL_CONFIG_DIR = rebar_dir:global_config_dir/1
%% REBAR_GLOBAL_CACHE_DIR = rebar_dir:global_cache_dir/1
Expand Down Expand Up @@ -42,6 +43,7 @@ create_env(State, Opts) ->
{"REBAR_BUILD_DIR", filename:absname(rebar_dir:base_dir(State))},
{"REBAR_ROOT_DIR", filename:absname(rebar_dir:root_dir(State))},
{"REBAR_CHECKOUTS_DIR", filename:absname(rebar_dir:checkouts_dir(State))},
{"REBAR_CHECKOUTS_OUT_DIR", filename:absname(rebar_dir:checkouts_out_dir(State))},
{"REBAR_PLUGINS_DIR", filename:absname(rebar_dir:plugins_dir(State))},
{"REBAR_GLOBAL_CONFIG_DIR", filename:absname(rebar_dir:global_config_dir(State))},
{"REBAR_GLOBAL_CACHE_DIR", filename:absname(rebar_dir:global_cache_dir(Opts))},
Expand Down
4 changes: 4 additions & 0 deletions src/rebar_prv_plugins.erl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ do(State) ->
Plugins = rebar_state:get(State, plugins, []),
ProjectPlugins = rebar_state:get(State, project_plugins, []),
PluginsDirs = filelib:wildcard(filename:join(rebar_dir:plugins_dir(State), "*")),

%% use `checkouts_dir' and not `checkouts_out_dir'. Since we use `all' in `find_apps'
%% so it doesn't need to be built and the apps in `checkouts_dir' could be old
%% because the user removing from `_checkouts/' doesn't cause removal of the output
CheckoutsDirs = filelib:wildcard(filename:join(rebar_dir:checkouts_dir(State), "*")),
Apps = rebar_app_discover:find_apps(CheckoutsDirs++PluginsDirs, SrcDirs, all, State),
display_plugins("Local plugins", Apps, Plugins ++ ProjectPlugins),
Expand Down

0 comments on commit 2101783

Please sign in to comment.