forked from tomas-abrahamsson/gpb
-
Notifications
You must be signed in to change notification settings - Fork 2
/
rebar.config.script
45 lines (35 loc) · 1.28 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
%% -*- erlang -*-
NoHaveMapsOpts = try maps:size(maps:new()) of
0 -> []
catch error:undef -> [{d,'NO_HAVE_MAPS',true}]
end.
%% In Erlang 19, the random module is deprecated
NoHaveRandOpts = try rand:uniform() of
F when is_float(F) -> []
catch error:undef -> [{d,'NO_HAVE_RAND',true}]
end.
ConfigOpts = NoHaveMapsOpts ++ NoHaveRandOpts.
[{require_otp_vsn, ".*"},
{pre_hooks,
[{compile,
%% invoking shell script as an argument to sh appears to be
%% needed with rebar for windows/cygwin
"sh build/mk_version_hrl"
" < include/gpb_version.hrl.in"
" > include/gpb_version.hrl "}
]},
%% Erlang compiler options
{erl_opts, [debug_info] ++ ConfigOpts},
%% This line is useful if you have gpb_eqc.erl symlinked to
%% the symlink in the test/ directory.
{eunit_compile_opts, [{i,"../include"}] ++ ConfigOpts},
{post_hooks,
[{compile,
%% way of invoking shell script: see above
"sh build/compile_descriptor"}]},
%% XRef checks to perform
{xref_checks, [undefined_function_calls]},
%% Clean files
{clean_files, [".eunit", "ebin/*.beam", "include/gpb_version.hrl",
"descr_src/gpb_descriptor.erl", "descr_src/gpb_descriptor.hrl"]}
].