summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-04-08 17:30:16 -0500
committerTristan Sloughter <t@crashfast.com>2015-04-08 17:30:16 -0500
commit23fa5c659bb40d968390828b28ba1305ad9836c7 (patch)
tree224c759af5cd062e32a4883b5ba7490ca616af04
parent0026b370634090c0470969a50a39847e877fbbe6 (diff)
breakout needs compile check from compile_xrl_yrl
-rw-r--r--src/rebar_erlc_compiler.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index f877a6d..62c4713 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -401,7 +401,7 @@ compile_xrl_yrl(Config, Source, Target, Opts, Mod) ->
Dir = rebar_state:dir(Config),
Opts1 = [{includefile, filename:join(Dir, I)} || {includefile, I} <- Opts,
filename:pathtype(I) =:= relative],
- case filelib:last_modified(Source) > filelib:last_modified(Target) of
+ case needs_compile(Source, Target) of
true ->
case Mod:file(Source, Opts1 ++ [{return, true}]) of
{ok, _} ->
@@ -416,6 +416,9 @@ compile_xrl_yrl(Config, Source, Target, Opts, Mod) ->
skipped
end.
+needs_compile(Source, Target) ->
+ filelib:last_modified(Source) > filelib:last_modified(Target).
+
gather_src([], Srcs) ->
Srcs;
gather_src([Dir|Rest], Srcs) ->