From b9d43cd8cd1771bdbedac0875cda920c68ee1e7f Mon Sep 17 00:00:00 2001 From: Lee GiTack Date: Mon, 18 Apr 2016 10:21:42 +0900 Subject: Fix compile error case when cover compilation Dependent libs is required for some module when cover compiling. So all dependencies should be available on code path. This fixes #1148 issue. --- src/rebar_prv_cover.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rebar_prv_cover.erl b/src/rebar_prv_cover.erl index c915141..87153e4 100644 --- a/src/rebar_prv_cover.erl +++ b/src/rebar_prv_cover.erl @@ -299,6 +299,7 @@ cover_compile(State, apps) -> ExtraDirs = extra_src_dirs(State, Apps), cover_compile(State, lists:filter(fun(D) -> ec_file:is_dir(D) end, AppDirs ++ ExtraDirs)); cover_compile(State, Dirs) -> + rebar_utils:update_code(rebar_state:code_paths(State, all_deps), [soft_purge]), %% start the cover server if necessary {ok, CoverPid} = start_cover(), %% redirect cover output @@ -316,7 +317,9 @@ cover_compile(State, Dirs) -> %% print any warnings about modules that failed to cover compile lists:foreach(fun print_cover_warnings/1, lists:flatten(Results)) end - end, Dirs). + end, Dirs), + rebar_utils:cleanup_code_path(rebar_state:code_paths(State, default)), + ok. app_dirs(Apps) -> lists:foldl(fun app_ebin_dirs/2, [], Apps). -- cgit v1.1