diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-04-20 18:25:31 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-04-20 18:31:10 -0500 |
commit | b8c1cb2bf0ffdff35da4754c19bde3da4d97b3ec (patch) | |
tree | 962af990147e5036197a8b53e66a50e9b01f8b0a | |
parent | 71dfa8eca6a87b29887b0faf09bf2f61b8409485 (diff) |
fix erl_first_files to check entire path of file
-rw-r--r-- | src/rebar_erlc_compiler.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index f245eb5..174f5f8 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -161,7 +161,7 @@ doterl_compile(Config, Dir, OutDir, MoreSources, ErlOpts) -> filename:extension(File) =:= ".erl"], NeededErlFiles = needed_files(G, ErlOpts, Dir, OutDir1, AllErlFiles), - ErlFirstFiles = erl_first_files(Config, NeededErlFiles), + ErlFirstFiles = erl_first_files(Config, Dir, NeededErlFiles), {DepErls, OtherErls} = lists:partition( fun(Source) -> digraph:in_degree(G, Source) > 0 end, [File || File <- NeededErlFiles, not lists:member(File, ErlFirstFiles)]), @@ -176,10 +176,11 @@ doterl_compile(Config, Dir, OutDir, MoreSources, ErlOpts) -> true = code:set_path(CurrPath), ok. -erl_first_files(Config, NeededErlFiles) -> +erl_first_files(Config, Dir, NeededErlFiles) -> ErlFirstFilesConf = rebar_state:get(Config, erl_first_files, []), %% NOTE: order of files in ErlFirstFiles is important! - [File || File <- ErlFirstFilesConf, lists:member(File, NeededErlFiles)]. + [filename:join(Dir, File) || File <- ErlFirstFilesConf, + lists:member(filename:join(Dir, File), NeededErlFiles)]. %% Get subset of SourceFiles which need to be recompiled, respecting %% dependencies induced by given graph G. |