summaryrefslogtreecommitdiff
path: root/src/rebar_otp_app.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2017-10-08 17:23:59 -0400
committerGitHub <noreply@github.com>2017-10-08 17:23:59 -0400
commit6d9037a5a4d9d6480ca061f47da62c66a5fbc16c (patch)
tree3154c1776e457f8e0155495f62c13082303522ce /src/rebar_otp_app.erl
parent4f6646bb1c8900f6ecb9e92ccc4c0b39219042c8 (diff)
parentc92e2682a0391eeef523ac87fb1a92f576455028 (diff)
Merge pull request #1640 from ferd/app-src-fixes
Various fixes related to .app files
Diffstat (limited to 'src/rebar_otp_app.erl')
-rw-r--r--src/rebar_otp_app.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rebar_otp_app.erl b/src/rebar_otp_app.erl
index ed573f2..1bc33b9 100644
--- a/src/rebar_otp_app.erl
+++ b/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