From 23fa5c659bb40d968390828b28ba1305ad9836c7 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Wed, 8 Apr 2015 17:30:16 -0500 Subject: breakout needs compile check from compile_xrl_yrl --- src/rebar_erlc_compiler.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -> -- cgit v1.1