소스 검색

Merge pull request #188 from massemanet/xref_extra_path

Xref extra path
pull/3/head
Andrew Thompson 11 년 전
부모
커밋
184edc2331
2개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. +5
    -0
      rebar.config.sample
  2. +3
    -0
      src/rebar_xref.erl

+ 5
- 0
rebar.config.sample 파일 보기

@ -221,6 +221,11 @@
{xref_warnings, false}. {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 to run
{xref_checks, [undefined_function_calls, undefined_functions, {xref_checks, [undefined_function_calls, undefined_functions,
locals_not_used, exports_not_used, locals_not_used, exports_not_used,

+ 3
- 0
src/rebar_xref.erl 파일 보기

@ -103,9 +103,11 @@ info(help, xref) ->
"Valid rebar.config options:~n" "Valid rebar.config options:~n"
" ~p~n" " ~p~n"
" ~p~n" " ~p~n"
" ~p~n"
" ~p~n", " ~p~n",
[ [
{xref_warnings, false}, {xref_warnings, false},
{xref_extra_paths,[]},
{xref_checks, [undefined_function_calls, undefined_functions, {xref_checks, [undefined_function_calls, undefined_functions,
locals_not_used, exports_not_used, locals_not_used, exports_not_used,
deprecated_function_calls, deprecated_functions]}, deprecated_function_calls, deprecated_functions]},
@ -146,6 +148,7 @@ code_path(Config) ->
%% properly into the overall compile code path if possible. %% properly into the overall compile code path if possible.
BaseDir = rebar_config:get_xconf(Config, base_dir), BaseDir = rebar_config:get_xconf(Config, base_dir),
[P || P <- code:get_path() ++ [P || P <- code:get_path() ++
rebar_config:get(Config, xref_extra_paths, []) ++
[filename:join(BaseDir, filename:join(SubDir, "ebin")) [filename:join(BaseDir, filename:join(SubDir, "ebin"))
|| SubDir <- rebar_config:get(Config, sub_dirs, [])], || SubDir <- rebar_config:get(Config, sub_dirs, [])],
filelib:is_dir(P)]. filelib:is_dir(P)].

불러오는 중...
취소
저장