add rebar.config.script for checking support maps and binary_to_{integer,float}/1

This commit is contained in:
Led 2015-08-03 00:44:49 +03:00
parent fef001479f
commit 446f674f27
3 changed files with 12 additions and 4 deletions

11
rebar.config.script Normal file
View file

@ -0,0 +1,11 @@
Def0 = case erlang:is_builtin(erlang, binary_to_integer, 1) andalso
erlang:is_builtin(erlang, binary_to_float, 1) of
true -> [];
false -> [{d, no_binary_to_whatever}]
end,
Defs = case erlang:is_builtin(erlang, is_map, 1) of
true -> [{d, maps_support}|Def0];
false -> Def0
end,
lists:keystore(erl_opts, 1, CONFIG,
{erl_opts, proplists:get_value(erl_opts, CONFIG, []) ++ Defs}).