%%-*- mode: erlang -*-


{erl_opts, [debug_info,
            {platform_define, "^(2[3-9])", 'USE_CRYPTO_MAC'}]}.

%% oauth is an optional dependency - ignore xref warnings for it
{xref_ignores, [{oauth, header_params_encode, 1}, {oauth, sign, 6}]}.

%% Only check for undefined function calls (not unused exports, which are expected for a library)
{xref_checks, [undefined_function_calls, undefined_functions, deprecated_function_calls]}.

%% Dialyzer configuration
%% - Include optional apps in PLT to avoid unknown function warnings
{dialyzer, [
    {plt_extra_apps, [mimerl, xmerl, oauth]}
]}.

{deps, [
    {hackney, "2.0.1"},
    %% oauth is optional - only needed if using OAuth authentication
    {oauth, "2.1.0"}
]}.


{project_plugins, [rebar3_ex_doc]}.

{hex, [{doc, ex_doc}]}.

{edoc_opts, [
    {preprocess, true},
    {report_missing_types, false},
    {includes, ["include"]}
]}.

{ex_doc, [
    {proglang, erlang},
    {extras, [
        {"README.md", #{title => <<"Overview">>}},
        {"NEWS.md", #{title => <<"Changelog">>}},
        {"guides/MIGRATION.md", #{title => <<"Migration Guide">>}},
        {"guides/changes.md", #{title => <<"Changes Feed">>}},
        {"guides/views.md", #{title => <<"Views">>}},
        {"LICENSE", #{title => <<"License">>}}
    ]},
    {main, "README.md"},
    {homepage_url, "https://github.com/benoitc/couchbeam"},
    {source_url, "https://github.com/benoitc/couchbeam"},
    {api_reference, true},
    {groups_for_modules, [
        {"Core", [couchbeam, couchbeam_doc, couchbeam_attachments]},
        {"Views & Changes", [couchbeam_view, couchbeam_changes]},
        {"Utilities", [couchbeam_ejson, couchbeam_httpc, couchbeam_util, couchbeam_uuids]},
        {"Application", [couchbeam_app, couchbeam_sup]}
    ]}
]}.

{profiles, [{test, [
                    {cover_enabled, true},
                    {eunit_opts, [verbose]},
                    {deps, [{oauth, "2.1.0"}, {meck, "0.9.2"}]}
                   ]}
           ]}.
