summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Luna <daniel@lunas.se>2012-08-28 13:22:57 -0400
committerDave Smith <dizzyd@dizzyd.com>2012-11-05 06:19:02 -0700
commitb1a947488b48db12c8f874f0b81232672b6ad810 (patch)
treece706a3aec60befad7dcebb7eb07bd4b8042a328
parent2b5844d14ca6a642bc7177263b8fbe632047e59d (diff)
Add all subdirs to xref library path
-rw-r--r--src/rebar_xref.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rebar_xref.erl b/src/rebar_xref.erl
index 144760a..42e6b9e 100644
--- a/src/rebar_xref.erl
+++ b/src/rebar_xref.erl
@@ -44,7 +44,7 @@
xref(Config, _) ->
%% Spin up xref
{ok, _} = xref:start(xref),
- ok = xref:set_library_path(xref, code_path()),
+ ok = xref:set_library_path(xref, code_path(Config)),
xref:set_default(xref, [{warnings,
rebar_config:get(Config, xref_warnings, false)},
@@ -132,9 +132,12 @@ check_query({Query, Value}) ->
true
end.
-code_path() ->
- [P || P <- code:get_path(),
- filelib:is_dir(P)] ++ [filename:join(rebar_utils:get_cwd(), "ebin")].
+code_path(Config) ->
+ BaseDir = rebar_config:get_xconf(Config, base_dir),
+ [P || P <- code:get_path() ++
+ [filename:join(BaseDir, filename:join(SubDir, "ebin"))
+ || SubDir <- rebar_config:get(Config, sub_dirs, [])],
+ filelib:is_dir(P)].
%%
%% Ignore behaviour functions, and explicitly marked functions