From 7cddb2a685996f28ce3c9870b8b11e3552bf5d05 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 10 Apr 2015 18:58:46 -0500 Subject: pass objectfile name to opts_changed instead of recalculating --- src/rebar_erlc_compiler.erl | 10 ++++------ 1 file 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), -- cgit v1.1