%%% -*-mode:erlang;coding:utf-8;tabidth,:4;c-basic-offset:4;indent-tabs-mode:()-*-
%%% ex: set ft=erlang fenc=utf-8 sts=4 ts=4 sw=4 et:
%%%

%%% Require OTP 19.1 at a bare minimum
{minimum_otp_vsn, "19.1"}.

%% Plugins
{plugins, [rebar3_hex]}.
{shell, [
    {apps, [lager, sync, gen_rpc]}
]}.

{erl_opts, [debug_info,
    {warn_format, 1},
    bin_opt_info,
    inline_list_funcs,
    warnings_as_errors,
    report_warnings,
    warn_untyped_record,
    warn_export_vars,
    warn_export_all,
    warn_shadow_vars,
    warn_obsolete_guard,
    warn_unused_import,
    warn_deprecated_function,
    warn_unused_vars,
    warn_unused_function,
    warn_bif_clash,
    warn_unused_record,
    warn_exported_vars
]}.

{deps, [
    {hut, "~> 1.2"},
    {ssl_verify_fun, "~> 1.1"}
]}.

{profiles, [
    {test, [
        {erl_opts, [{d,'TEST'},
            {d,'HUT_LAGER'},
            {parse_transform, lager_transform},
            warnings_as_errors,
            export_all,
            no_inline_list_funcs]},
        {deps, [{lager, "~> 3.0"},
            {eunit_formatters, "~> 0.3"}
        ]}
    ]},
    {dev, [
        {erl_opts, [{d,'HUT_LAGER'},
            {parse_transform, lager_transform},
            warnings_as_errors,
            no_inline_list_funcs]},
        {deps, [{lager, "~> 3.0"},
            {sync, {git, "git://github.com/rustyio/sync.git", {branch, "master"}}}
        ]}
    ]}
]}.

%% Code coverage
{cover_enabled, true}.
{cover_export_enabled, true}.
{cover_opts, [verbose]}.

%% Coveralls code coverage reporting
{coveralls_coverdata, "_build/test/cover/ct.coverdata"}.
{coveralls_service_name, "travis-ci"}.
{do_coveralls_after_ct, false}.
{do_coveralls_after_eunit, false}.

%% EUnit options
{eunit_compile_opts, [warnings_as_errors, debug_info, export_all]}.
{eunit_opts, [verbose,
    no_tty,
    {report, {eunit_progress, [colored, profile]}}
]}.

%% Common Test options
{ct_opts, [{logdir, "log/ct"},
    {dir, "test"},
    {cover, "test/gen_rpc.coverspec"},
    {suite, [
        local_SUITE,
        remote_SUITE,
        multi_rpc_SUITE
    ]}
]}.

% Dialyzer
{dialyzer, [
    {warnings, [unmatched_returns, error_handling]},
    {get_warnings, true},
    {plt_location, "_plt"},
    {base_plt_location, global},
    {base_plt_apps, [asn1, crypto, edoc, erts, eunit, inets, kernel, mnesia, public_key, ssl, stdlib, xmerl]}
]}.

%% XRef
{xref_warnings, true}.
{xref_extra_paths, []}.
{xref_checks, [undefined_function_calls, undefined_functions, locals_not_used,
               deprecated_function_calls, deprecated_functions]}.
