summaryrefslogtreecommitdiff
path: root/src/rebar_erlc_compiler.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_erlc_compiler.erl')
-rw-r--r--src/rebar_erlc_compiler.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 624fe0b..4c76429 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -165,7 +165,8 @@ doterl_compile(Config, Dir, OutDir, MoreSources, ErlOpts) ->
{DepErls, OtherErls} = lists:partition(
fun(Source) -> digraph:in_degree(G, Source) > 0 end,
[File || File <- NeededErlFiles, not lists:member(File, ErlFirstFiles)]),
- DepErlsOrdered = digraph_utils:topsort(digraph_utils:subgraph(G, DepErls)),
+ SubGraph = digraph_utils:subgraph(G, DepErls),
+ DepErlsOrdered = digraph_utils:topsort(SubGraph),
FirstErls = ErlFirstFiles ++ lists:reverse(DepErlsOrdered),
?DEBUG("Files to compile first: ~p", [FirstErls]),
rebar_base_compiler:run(
@@ -177,6 +178,8 @@ doterl_compile(Config, Dir, OutDir, MoreSources, ErlOpts) ->
end,
internal_erl_compile(C, Dir, S, OutDir1, ErlOpts1)
end),
+ true = digraph:delete(SubGraph),
+ true = digraph:delete(G),
ok.
%% Get files which need to be compiled first, i.e. those specified in erl_first_files