From 8d31d559c18b12d3d06655de2ca9c7f76c67c948 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 9 Nov 2018 12:22:12 -0700 Subject: check last modified time on erl files for xrl and yrl files before compiling --- src/rebar_compiler_xrl.erl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/rebar_compiler_xrl.erl') diff --git a/src/rebar_compiler_xrl.erl b/src/rebar_compiler_xrl.erl index 5c023f0..23ed1eb 100644 --- a/src/rebar_compiler_xrl.erl +++ b/src/rebar_compiler_xrl.erl @@ -3,7 +3,7 @@ -behaviour(rebar_compiler). -export([context/1, - needed_files/3, + needed_files/4, dependencies/3, compile/4, clean/2]). @@ -16,11 +16,13 @@ context(AppInfo) -> src_ext => ".xrl", out_mappings => Mappings}. -needed_files(_, FoundFiles, AppInfo) -> +needed_files(_, FoundFiles, Mappings, AppInfo) -> FirstFiles = [], %% Remove first files from found files - RestFiles = [Source || Source <- FoundFiles, not lists:member(Source, FirstFiles)], + RestFiles = [Source || Source <- FoundFiles, + not lists:member(Source, FirstFiles), + rebar_compiler:needs_compile(Source, ".erl", Mappings)], Opts = rebar_opts:get(rebar_app_info:opts(AppInfo), xrl_opts, []), -- cgit v1.1