summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-04-20 20:33:26 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-04-20 20:33:26 -0400
commit31ef4c491689f2e3166e4365455ebf86374ab8a2 (patch)
tree32ef081389b5660cc715651ebe5fb41334983a6a
parentb5ef1c09d77268348f2962938519774a11817ce4 (diff)
parentb8c1cb2bf0ffdff35da4754c19bde3da4d97b3ec (diff)
Merge pull request #357 from tsloughter/erl_first_files
fix erl_first_files to check entire path of file
-rw-r--r--src/rebar_erlc_compiler.erl7
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.