diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2018-11-18 11:27:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-18 11:27:26 -0500 |
commit | 9c24f558721cd9e63f79e16bc623fbee78ab1739 (patch) | |
tree | 7bb1aed9bf983731c88df44dc990049002fc2e65 /src/rebar_compiler_yrl.erl | |
parent | 62663bc0ba05992d0237a14605d2d43f1820833b (diff) | |
parent | beb8878a6c73d37e05a167b974d965ede005f2f8 (diff) |
Merge pull request #1938 from erlang/xrl-yrl-recompile
check last modified time on erl files for xrl and yrl files before compiling
Diffstat (limited to 'src/rebar_compiler_yrl.erl')
-rw-r--r-- | src/rebar_compiler_yrl.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rebar_compiler_yrl.erl b/src/rebar_compiler_yrl.erl index 41d93b1..9c1767e 100644 --- a/src/rebar_compiler_yrl.erl +++ b/src/rebar_compiler_yrl.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 => ".yrl", 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), yrl_opts, []), {{FirstFiles, Opts}, {RestFiles, Opts}}. |