소스 검색

Merge pull request #37 from nox/force-registered

Ensure we always have a `registered` value in `.app` files
pull/3/head
Dave Smith 12 년 전
부모
커밋
2f4de5359c
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. +14
    -1
      src/rebar_otp_app.erl

+ 14
- 1
src/rebar_otp_app.erl 파일 보기

@ -119,8 +119,12 @@ preprocess(Config, AppSrcFile) ->
{Config2, Vsn} = rebar_app_utils:app_vsn(Config1, AppSrcFile),
A2 = lists:keystore(vsn, 1, A1, {vsn, Vsn}),
%% systools:make_relup/4 fails with {missing_param, registered}
%% without a 'registered' value.
A3 = ensure_registered(A2),
%% Build the final spec as a string
Spec = io_lib:format("~p.\n", [{application, AppName, A2}]),
Spec = io_lib:format("~p.\n", [{application, AppName, A3}]),
%% Setup file .app filename and write new contents
AppFile = rebar_app_utils:app_src_to_app(AppSrcFile),
@ -205,3 +209,12 @@ validate_modules(AppName, Mods) ->
ebin_modules() ->
lists:sort([rebar_utils:beam_to_mod("ebin", N) ||
N <- rebar_utils:beams("ebin")]).
ensure_registered(AppData) ->
case lists:keyfind(registered, 1, AppData) of
false ->
[{registered, []} | AppData];
{registered, _} ->
%% We could further check whether the value is a list of atoms.
AppData
end.

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