%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-

{erl_opts, [
    debug_info,
    warnings_as_errors,
    warn_missing_spec,
    {feature, maybe_expr, enable}
]}.

{src_dirs, [{"src", [{recursive, true}]}]}.

{deps, [
    {asobi, "~> 0.72"}
]}.

{profiles, [
    {test, [
        {erl_opts, [nowarn_export_all, nowarn_missing_spec, warnings_as_errors, {i, "test"}]},
        {ct_opts, [{sys_config, "./config/test_sys.config"}]},
        {extra_src_dirs, [{"test", [{recursive, true}]}]},
        {xref_extra_paths, ["test"]}
    ]}
]}.

{dialyzer, [
    {plt_apps, all_deps},
    {plt_extra_apps, [kura, asobi, shigoto]},
    {warnings, [unknown, unmatched_returns]}
]}.

{project_plugins, [
    {rebar3_kura, {git, "https://github.com/Taure/rebar3_kura.git", {tag, "v0.16.1"}}},
    {rebar3_audit, {git, "https://github.com/Taure/rebar3_audit.git", {tag, "v0.2.7"}}},
    {asobi, "~> 0.72"},
    rebar3_ex_doc,
    covertool,
    {erlfmt, "~>1.7"}
]}.

{cover_enabled, true}.
{cover_export_enabled, true}.
{covertool, [{coverdata_files, ["eunit.coverdata", "ct.coverdata"]}]}.

{hex, [
    {doc, #{provider => ex_doc}},
    {include_files, [
        <<"src">>,
        <<"rebar.config">>,
        <<"rebar.lock">>,
        <<"README.md">>,
        <<"guides">>
    ]}
]}.

{ex_doc, [
    {source_url, <<"https://github.com/widgrensit/asobi_quests">>},
    {extras, [<<"README.md">>, <<"guides/quests.md">>, <<"LICENSE">>]},
    {groups_for_modules, [
        {<<"Contract">>, [asobi_quests_extension]},
        {<<"Domain">>, [asobi_quests, asobi_quests_period]},
        {<<"Adapters">>, [asobi_quests_lua, asobi_quests_rpc]},
        {<<"Schemas">>, [asobi_quest, asobi_quest_progress]},
        {<<"Processes">>, [asobi_quests_cache, asobi_quests_rollover_worker]}
    ]}
]}.

{erlfmt, [
    write,
    {files, [
        "rebar.config",
        "src/*.app.src",
        "src/**/{*.erl, *.hrl}",
        "test/**/{*.erl, *.hrl}"
    ]}
]}.

{xref_checks, [
    undefined_function_calls,
    undefined_functions,
    locals_not_used,
    deprecated_function_calls,
    deprecated_functions
]}.
