Current section

Files

Jump to
gpb rebar.config.script
Raw

rebar.config.script

%% -*- 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, ".*"},
%% Erlang compiler options
{erl_opts, [debug_info] ++ ConfigOpts},
{erl_first_files, ["src/gpb_codegen.erl"]},
%% This line is useful if you have gpb_eqc.erl symlinked to
%% the symlink in the test/ directory.
{eunit_compile_opts, [{i,"../include"}] ++ ConfigOpts},
{edoc_opts, [{preprocess,true}]},
{post_hooks,
[{compile,
%% way of invoking shell script: see above
"sh -c \""
" sh build/prepend_edoc_autogenerated src/gpb_scan.erl src/gpb_scan.xrl"
" &&"
" 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"]}
].