diff options
Diffstat (limited to 'src/rebar_prv_cover.erl')
-rw-r--r-- | src/rebar_prv_cover.erl | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/rebar_prv_cover.erl b/src/rebar_prv_cover.erl index c915141..464967b 100644 --- a/src/rebar_prv_cover.erl +++ b/src/rebar_prv_cover.erl @@ -296,9 +296,9 @@ strip_coverdir(File) -> cover_compile(State, apps) -> Apps = filter_checkouts(rebar_state:project_apps(State)), AppDirs = app_dirs(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, lists:filter(fun(D) -> ec_file:is_dir(D) end, AppDirs)); 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,27 +316,15 @@ 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). app_ebin_dirs(App, Acc) -> - AppDir = rebar_app_info:ebin_dir(App), - ExtraDirs = rebar_dir:extra_src_dirs(rebar_app_info:opts(App), []), - OutDir = rebar_app_info:out_dir(App), - [AppDir] ++ [filename:join([OutDir, D]) || D <- ExtraDirs] ++ Acc. - -extra_src_dirs(State, Apps) -> - BaseDir = rebar_state:dir(State), - F = fun(App) -> rebar_app_info:dir(App) == BaseDir end, - %% check that this app hasn't already been dealt with - Extras = case lists:any(F, Apps) of - false -> rebar_dir:extra_src_dirs(rebar_state:opts(State), []); - true -> [] - end, - OutDir = rebar_dir:base_dir(State), - [filename:join([OutDir, "extras", D]) || D <- Extras]. + [rebar_app_info:ebin_dir(App)|Acc]. filter_checkouts(Apps) -> filter_checkouts(Apps, []). |