% -*- mode: erlang; -*- vim: set ft=erlang:

%% == Erlang Compiler == %%

{minimum_otp_vsn, "21.0"}. % but only 24+ is supported

{erl_opts, [
    debug_info,
    warn_export_vars,
    warn_missing_spec,
    warn_unused_import,
    warnings_as_errors,
    {platform_define, "^22\\.", 'NO_CT_SUITE_BEHAVIOUR'},
    {platform_define, "^23\\.[0-1]", 'NO_CT_SUITE_BEHAVIOUR'}
]}.

%% == Dependencies and plugins ==

{deps, []}.

{project_plugins, [
    {rebar3_ex_doc, "0.2.31"},
    {rebar3_hank, "1.3.0"}, % excluded on OTP 22 (see rebar.config.script)
    {rebar3_hex, "7.0.4"},
    {rebar3_lint, "2.0.1"}
]}.

%% == Dialyzer ==

{dialyzer, [
    {warnings, [
        error_handling,
        underspecs,
        unknown,
        unmatched_returns
    ]},
    {plt_extra_apps, [
        common_test
    ]}
]}.

%% == Xref ==

{xref_checks, [
    deprecated_function_calls,
    exports_not_used,
    locals_not_used,
    undefined_function_calls
]}.

%% == Profiles ==

{profiles, [
    {test, [
        {erl_opts, [
            debug_info,
            nowarn_export_all,
            nowarn_missing_spec,
            nowarnings_as_errors
        ]},
        {shell, [
            {apps, [lager]},
            {config, "test/config/sys.config"}
        ]},
        {cover_enabled, true},
        {cover_opts, [verbose]}
    ]},

    {docs, [
        {edoc_opts, [
            {preprocess, true},
            {doclet, edoc_doclet_chunks},
            {layout, edoc_layout_chunks},
            {dir, "_build/default/lib/lager/doc"}
        ]}
    ]}
]}.

%% == ex_doc ==

{ex_doc, [
    {prefix_ref_vsn_with_v, false},
    {source_url, <<"https://github.com/g-andrade/fake_lager">>},
    {extras, [<<"README.md">>, <<"CHANGELOG.md">>, <<"LICENSE">>]},
    {main, <<"readme">>},
    {proglang, erlang}
]}.
{hex, [
    {doc, #{
        provider => ex_doc
    }}
]}.

%% == rebar3_hank ==

{hank, [
    {ignore, [
        {"include/lager.hrl", [
            single_use_hrl_attrs,
            unused_macros
        ]}
    ]}
]}.
