Browse Source

Merge pull request #994 from talentdeficit/REBAR-950

warn if the directories `eunit' or `ct' show up in `src_dirs'
pull/1005/head
Fred Hebert 9 years ago
parent
commit
99627b161c
1 changed files with 17 additions and 2 deletions
  1. +17
    -2
      src/rebar_prv_compile.erl

+ 17
- 2
src/rebar_prv_compile.erl View File

@ -247,6 +247,21 @@ resolve_src_dirs(Opts) ->
%% in src_dirs also exist in extra_src_dirs
normalize_src_dirs(SrcDirs, ExtraDirs) ->
S = lists:usort(SrcDirs),
E = lists:usort(ExtraDirs),
{S, lists:subtract(E, S)}.
E = lists:subtract(lists:usort(ExtraDirs), S),
ok = warn_on_problematic_directories(S ++ E),
{S, E}.
%% warn when directories called `eunit' and `ct' are added to compile dirs
warn_on_problematic_directories(AllDirs) ->
F = fun(Dir) ->
case is_a_problem(Dir) of
true -> ?WARN("Possible name clash with directory ~p.", [Dir]);
false -> ok
end
end,
lists:foreach(F, AllDirs).
is_a_problem("eunit") -> true;
is_a_problem("common_test") -> true;
is_a_problem(_) -> false.

Loading…
Cancel
Save