summaryrefslogtreecommitdiff
path: root/src/rebar_prv_compile.erl
diff options
context:
space:
mode:
authoralisdair sullivan <alisdair.sullivan@askuity.com>2016-01-05 16:55:12 -0800
committeralisdair sullivan <alisdairsullivan@yahoo.ca>2016-01-05 17:02:28 -0800
commitb29c080931db45eb252d3c1e4cd113a57779c8b2 (patch)
tree3ca0e368fbf4fc926f5bc22dce2d2157bb3af874 /src/rebar_prv_compile.erl
parent46b4b059b0ccac85d8fc26bd25044a5b26e6c723 (diff)
warn if the directories `eunit' or `ct' show up in `src_dirs'
if these directories actually exist they'll be added to the path ahead of the release/standard distribution directories and they'll break eunit and/or ct execution fixes #950
Diffstat (limited to 'src/rebar_prv_compile.erl')
-rw-r--r--src/rebar_prv_compile.erl19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl
index d57b82b..30af90b 100644
--- a/src/rebar_prv_compile.erl
+++ b/src/rebar_prv_compile.erl
@@ -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.