summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-04-10 18:58:46 -0500
committerTristan Sloughter <t@crashfast.com>2015-04-10 18:58:46 -0500
commit7cddb2a685996f28ce3c9870b8b11e3552bf5d05 (patch)
treef3408568ed0d3e6b38bd4928f99c3f52db2fae89
parent1de5058330b30ed17268602e9eac205e6bddce6f (diff)
pass objectfile name to opts_changed instead of recalculating
-rw-r--r--src/rebar_erlc_compiler.erl10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 355ec3c..5bd04d2 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -178,17 +178,15 @@ erl_first_files(Config, NeededErlFiles) ->
%% dependencies induced by given graph G.
needed_files(G, ErlOpts, Dir, OutDir, SourceFiles) ->
lists:filter(fun(Source) ->
- Target = target_base(OutDir, Source) ++ ".beam",
+ TargetBase = target_base(OutDir, Source),
+ Target = TargetBase ++ ".beam",
Opts = [{outdir, filename:dirname(Target)}
,{i, filename:join(Dir, "include")}] ++ ErlOpts,
digraph:vertex(G, Source) > {Source, filelib:last_modified(Target)}
- orelse opts_changed(Opts, Target)
+ orelse opts_changed(Opts, TargetBase)
end, SourceFiles).
-opts_changed(Opts, Target) ->
- Basename = filename:basename(Target, ".beam"),
- Dirname = filename:dirname(Target),
- ObjectFile = filename:join([Dirname, Basename]),
+opts_changed(Opts, ObjectFile) ->
case code:load_abs(ObjectFile) of
{module, Mod} ->
Compile = Mod:module_info(compile),