diff options
author | Andrew Thompson <andrew@hijacked.us> | 2014-02-06 01:04:35 -0500 |
---|---|---|
committer | Andrew Thompson <andrew@hijacked.us> | 2014-02-06 01:04:35 -0500 |
commit | 184edc2331042a59e6f1ae3d29306067f55c36e7 (patch) | |
tree | e68d145ec96fcc821aa1e0fdc5302b471f298948 | |
parent | daf1428f958ddcd59fbe0b060f96b889745db34c (diff) | |
parent | 4ca7c8417971239ac773c530974e9acce327cc86 (diff) |
Merge pull request #188 from massemanet/xref_extra_path
Xref extra path
-rw-r--r-- | rebar.config.sample | 5 | ||||
-rw-r--r-- | src/rebar_xref.erl | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/rebar.config.sample b/rebar.config.sample index e6071bd..30d28d0 100644 --- a/rebar.config.sample +++ b/rebar.config.sample @@ -221,6 +221,11 @@ {xref_warnings, false}. +%% optional extra paths to include in xref:set_library_path/2. +%% specified relative location of rebar.config. +%% e.g. {xref_extra_paths,["../gtknode/src"]} +{xref_extra_paths,[]}. + %% xref checks to run {xref_checks, [undefined_function_calls, undefined_functions, locals_not_used, exports_not_used, diff --git a/src/rebar_xref.erl b/src/rebar_xref.erl index 0d89460..91fb60d 100644 --- a/src/rebar_xref.erl +++ b/src/rebar_xref.erl @@ -103,9 +103,11 @@ info(help, xref) -> "Valid rebar.config options:~n" " ~p~n" " ~p~n" + " ~p~n" " ~p~n", [ {xref_warnings, false}, + {xref_extra_paths,[]}, {xref_checks, [undefined_function_calls, undefined_functions, locals_not_used, exports_not_used, deprecated_function_calls, deprecated_functions]}, @@ -146,6 +148,7 @@ code_path(Config) -> %% properly into the overall compile code path if possible. BaseDir = rebar_config:get_xconf(Config, base_dir), [P || P <- code:get_path() ++ + rebar_config:get(Config, xref_extra_paths, []) ++ [filename:join(BaseDir, filename:join(SubDir, "ebin")) || SubDir <- rebar_config:get(Config, sub_dirs, [])], filelib:is_dir(P)]. |