summaryrefslogtreecommitdiff
path: root/src/rebar_prv_xref.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2017-06-08 20:09:18 -0400
committerGitHub <noreply@github.com>2017-06-08 20:09:18 -0400
commit5b7d478195a1684c601a3b5e8371bb8a5e36d1f7 (patch)
treee1bf69f66357c7e39e3eb1c48050d9268ef1582b /src/rebar_prv_xref.erl
parent8750a677695157af3655d6a354215a4a43fab73d (diff)
parent9a6f04a2d9d00167e0b853776b60b12b5c5dcc57 (diff)
Merge pull request #1569 from ferd/fix-xref-circular-dep-crash
Fix xref compile hook on deps
Diffstat (limited to 'src/rebar_prv_xref.erl')
-rw-r--r--src/rebar_prv_xref.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rebar_prv_xref.erl b/src/rebar_prv_xref.erl
index c4e72e7..51154b5 100644
--- a/src/rebar_prv_xref.erl
+++ b/src/rebar_prv_xref.erl
@@ -97,8 +97,11 @@ prepare(State) ->
rebar_state:get(State, xref_warnings, false)},
{verbose, rebar_log:is_verbose(State)}]),
- [{ok, _} = xref:add_directory(xref, rebar_app_info:ebin_dir(App))
- || App <- rebar_state:project_apps(State)],
+ [{ok, _} = xref:add_directory(xref, Dir)
+ || App <- rebar_state:project_apps(State),
+ %% the directory may not exist in rare cases of a compile
+ %% hook of a dep running xref prior to the full job being done
+ Dir <- [rebar_app_info:ebin_dir(App)], filelib:is_dir(Dir)],
%% Get list of xref checks we want to run
ConfXrefChecks = rebar_state:get(State, xref_checks,