forked from webmachine/webmachine
-
Notifications
You must be signed in to change notification settings - Fork 28
/
rebar.config.script
25 lines (25 loc) · 1011 Bytes
/
rebar.config.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
OtpVersion = erlang:system_info(otp_release),
Config1 = case hd(OtpVersion) =:= $R andalso OtpVersion < "R15B02" of
true ->
HashDefine = [{d,old_hash}],
case lists:keysearch(erl_opts, 1, CONFIG) of
{value, {erl_opts, Opts}} ->
lists:keyreplace(erl_opts,1,CONFIG,{erl_opts,Opts++HashDefine});
false ->
CONFIG ++ [{erl_opts, HashDefine}]
end;
false -> CONFIG
end,
if
OtpVersion >= "21" ->
case lists:keysearch(erl_opts, 1, Config1) of
{value, {erl_opts, Opts2}} ->
lists:keyreplace(erl_opts, 1, Config1, {erl_opts, [{d, deprecate_stacktrace}|Opts2]});
false ->
[{erl_opts, [{d, deprecate_stacktrace}]}|Config1]
end;
true ->
Config1
end.