diff options
author | Motiejus Jakštys <motiejus.jakstys@spilgames.com> | 2012-08-09 09:09:47 +0200 |
---|---|---|
committer | Motiejus Jakštys <motiejus.jakstys@spilgames.com> | 2012-08-09 09:48:16 +0200 |
commit | 8f01d0de60268a6867bba512128044b8e4e75c69 (patch) | |
tree | 73113befe84348f76ed80da8fa84e647dd1c17ae /src | |
parent | e5569e6862e24d978361f078eaf6e50e7dc86bee (diff) |
Add skip_deps=AppListSeparatedByCommas feature
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_deps.erl | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 67652e3..c79e4c1 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -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)}. |