소스 검색

Add a description in compiled app file if undef

Same default value as used in relx and other environments, but as
reported in #979 some tools don't like having no description available.
pull/1640/head
Fred Hebert 7 년 전
부모
커밋
13260ed621
1개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. +13
    -1
      src/rebar_otp_app.erl

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

@ -117,8 +117,11 @@ preprocess(State, AppInfo, AppSrcFile) ->
%% without a 'registered' value.
A3 = ensure_registered(A2),
%% some tools complain if a description is not present.
A4 = ensure_description(A3),
%% Build the final spec as a string
Spec = io_lib:format("~p.\n", [{application, AppName, A3}]),
Spec = io_lib:format("~p.\n", [{application, AppName, A4}]),
%% Setup file .app filename and write new contents
EbinDir = rebar_app_info:ebin_dir(AppInfo),
@ -195,6 +198,15 @@ ensure_registered(AppData) ->
AppData
end.
ensure_description(AppData) ->
case lists:keyfind(description, 1, AppData) of
false ->
%% Required for releases to work.
[{description, ""} | AppData];
{description, _} ->
AppData
end.
%% In the case of *.app.src we want to give the user the ability to
%% dynamically script the application resource file (think dynamic version
%% string, etc.), in a way similar to what can be done with the rebar

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