mirror of
https://github.com/correl/rebar.git
synced 2024-11-15 03:00:18 +00:00
Add skip_deps=AppListSeparatedByCommas feature
This commit is contained in:
parent
e5569e6862
commit
8f01d0de60
1 changed files with 20 additions and 8 deletions
|
@ -68,15 +68,27 @@ preprocess(Config, _) ->
|
|||
%% If skip_deps=true, mark each dep dir as a skip_dir w/ the core so that
|
||||
%% the current command doesn't run on the dep dir. However, pre/postprocess
|
||||
%% WILL run (and we want it to) for transitivity purposes.
|
||||
%%
|
||||
%% Also, if skip_deps=comma,separated,app,list, then only the given
|
||||
%% dependencies are skipped.
|
||||
NewConfig = case rebar_config:get_global(Config3, skip_deps, false) of
|
||||
"true" ->
|
||||
lists:foldl(
|
||||
fun(#dep{dir = Dir}, C) ->
|
||||
rebar_config:set_skip_dir(C, Dir)
|
||||
end, Config3, AvailableDeps);
|
||||
_ ->
|
||||
Config3
|
||||
end,
|
||||
"true" ->
|
||||
lists:foldl(
|
||||
fun(#dep{dir = Dir}, C) ->
|
||||
rebar_config:set_skip_dir(C, Dir)
|
||||
end, Config3, AvailableDeps);
|
||||
Apps when is_list(Apps) ->
|
||||
SkipApps = [list_to_atom(App) || App <- string:tokens(Apps, ",")],
|
||||
lists:foldl(
|
||||
fun(#dep{dir = Dir, app = App}, C) ->
|
||||
case lists:member(App, SkipApps) of
|
||||
true -> rebar_config:set_skip_dir(C, Dir);
|
||||
false -> C
|
||||
end
|
||||
end, Config3, AvailableDeps);
|
||||
_ ->
|
||||
Config3
|
||||
end,
|
||||
|
||||
%% Return all the available dep directories for process
|
||||
{ok, NewConfig, dep_dirs(AvailableDeps)}.
|
||||
|
|
Loading…
Reference in a new issue