Merge pull request #293 from Motiejus/skip_deps

Add skip_deps=AppListSeparatedByCommas feature.

I agree it's a bit of a weird thing, but it's a reasonable and safe extension. When time comes to properly overhaul stuff, skip_deps should disappear entirely.
This commit is contained in:
Dave Smith 2012-10-31 19:47:13 -07:00
commit 6eb7c08499

View file

@ -69,15 +69,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,
%% Filtering out 'raw' dependencies so that no commands other than
%% deps-related can be executed on their directories.