From ffbb31e660c4903a7f8240ee917d7125459aac44 Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Tue, 17 Feb 2015 15:44:05 -0800 Subject: purge mods loaded during check to see if they need to be recompiled during compile task before running subsequent tasks --- src/rebar_erlc_compiler.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index 14e6349..330f20b 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -265,9 +265,11 @@ opts_changed(Opts, Target) -> case code:load_abs(ObjectFile) of {module, Mod} -> Compile = Mod:module_info(compile), + %% dialyzer and eunit have trouble without the next two lines + code:delete(Mod), + code:purge(Mod), lists:sort(Opts) =/= lists:sort(proplists:get_value(options, - Compile, - undefined)); + Compile)); {error, nofile} -> true end. -- cgit v1.1