소스 검색

Setup code path prior to calling edoc

Setup code path prior to calling edoc so that edown, asciiedoc,
and the like can work properly when generating their own
documentation.
pull/3/head
Joseph Wayne Norton 13 년 전
committed by Tuncer Ayaz
부모
커밋
4a5114b79f
1개의 변경된 파일19개의 추가작업 그리고 0개의 파일을 삭제
  1. +19
    -0
      src/rebar_edoc.erl

+ 19
- 0
src/rebar_edoc.erl 파일 보기

@ -48,7 +48,26 @@
%% @doc Generate Erlang program documentation.
-spec doc(Config::rebar_config:config(), File::file:filename()) -> ok.
doc(Config, File) ->
%% Save code path
CodePath = setup_code_path(),
{ok, AppName, _AppData} = rebar_app_utils:load_app_file(File),
EDocOpts = rebar_config:get(Config, edoc_opts, []),
ok = edoc:application(AppName, ".", EDocOpts),
%% Restore code path
true = code:set_path(CodePath),
ok.
%% ===================================================================
%% Internal functions
%% ===================================================================
setup_code_path() ->
%% Setup code path prior to calling edoc so that edown, asciiedoc,
%% and the like can work properly when generating their own
%% documentation.
CodePath = code:get_path(),
true = code:add_patha(ebin_dir()),
CodePath.
ebin_dir() ->
filename:join(rebar_utils:get_cwd(), "ebin").

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