{erl_opts, [
    debug_info,
    {i, "include"},
    warnings_as_errors,
    warn_unused_vars,
    warn_export_all,
    warn_shadow_vars,
    warn_unused_import,
    warn_unused_function,
    warn_bif_clash,
    warn_unused_record,
    warn_deprecated_function,
    warn_obsolete_guard,
    warn_export_vars,
    warn_exported_vars
]}.

%% Dependencies
%% macula is optional - only needed for distributed mesh mode
{deps, [
    {macula_tweann, "~> 0.18.0"}
    %% Uncomment to enable mesh distribution:
    %% {macula, "~> 0.14.2"}
]}.

%% Project plugins
{project_plugins, [
    rebar3_hex,
    rebar3_ex_doc
]}.

%% Documentation with ex_doc
{ex_doc, [
    {extras, [
        {"guides/overview.md", #{title => "Overview"}},
        {"guides/getting-started.md", #{title => "Getting Started"}},
        {"guides/custom-evaluator.md", #{title => "Custom Evaluators"}},
        {"guides/evolution-strategies.md", #{title => "Evolution Strategies"}},
        {"guides/self-play.md", #{title => "Self-Play Training"}},
        {"guides/meta-controller.md", #{title => "LTC Meta-Controller"}},
        {"guides/liquid-conglomerate.md", #{title => "The Liquid Conglomerate"}},
        {"guides/cooperative-silos.md", #{title => "Cooperative Silos"}},
        {"guides/behavioral-events.md", #{title => "Behavioral Events"}},
        {"guides/lineage-tracking.md", #{title => "Lineage Tracking"}},
        {"guides/topology-evolution.md", #{title => "Topology Evolution Roadmap"}},
        {"guides/interoperability.md", #{title => "Interoperability"}},
        {"guides/inference-scenarios.md", #{title => "Inference Scenarios"}},
        {"guides/swarm-robotics.md", #{title => "Swarm Robotics"}},
        %% Silo Guides
        {"guides/silos/lc-overview.md", #{title => "LC Overview"}},
        {"guides/silos/task-silo.md", #{title => "Task Silo"}},
        {"guides/silos/resource-silo.md", #{title => "Resource Silo"}},
        {"guides/silos/distribution-silo.md", #{title => "Distribution Silo"}},
        {"guides/silos/temporal-silo.md", #{title => "Temporal Silo"}},
        {"guides/silos/morphological-silo.md", #{title => "Morphological Silo"}},
        {"guides/silos/economic-silo.md", #{title => "Economic Silo"}},
        {"guides/silos/competitive-silo.md", #{title => "Competitive Silo"}},
        {"guides/silos/social-silo.md", #{title => "Social Silo"}},
        {"guides/silos/cultural-silo.md", #{title => "Cultural Silo"}},
        {"guides/silos/ecological-silo.md", #{title => "Ecological Silo"}},
        {"guides/silos/developmental-silo.md", #{title => "Developmental Silo"}},
        {"guides/silos/regulatory-silo.md", #{title => "Regulatory Silo"}},
        {"guides/silos/communication-silo.md", #{title => "Communication Silo"}},
        {"README.md", #{title => "README"}}
    ]},
    {assets, #{
        "guides/assets" => "assets",
        "guides/silos/assets" => "assets",
        "assets" => "assets"
    }},
    {main, "overview"},
    {source_url, "https://github.com/macula-io/macula-neuroevolution"},
    {prefix_ref_vsn_with_v, false}
]}.

%% Hex.pm package metadata
{hex, [
    {doc, #{provider => ex_doc}},
    {files, [
        "src",
        "include",
        "guides",
        "assets",
        "rebar.config",
        "rebar.lock",
        "README.md",
        "LICENSE"
    ]}
]}.

%% Test configuration
{eunit_opts, [
    verbose,
    {report, {eunit_surefire, [{dir, "_build/test/logs"}]}}
]}.

{cover_enabled, true}.
{cover_opts, [verbose]}.
{cover_export_enabled, true}.

%% Dialyzer configuration
{dialyzer, [
    {warnings, [
        unmatched_returns,
        error_handling,
        unknown
    ]},
    {plt_apps, top_level_deps},
    {plt_location, local},
    {base_plt_location, global}
]}.

%% Profiles
{profiles, [
    {test, [
        {erl_opts, [
            debug_info,
            nowarn_export_all,
            {i, "include"}
        ]},
        {extra_src_dirs, [
            "test"
        ]}
    ]},
    %% Mesh profile - includes macula for distributed mode
    {mesh, [
        {deps, [
            {macula_tweann, "~> 0.18.0"},
            {macula, {git, "https://github.com/macula-io/macula.git", {tag, "v0.14.2"}}}
        ]},
        {erl_opts, [
            debug_info,
            {d, 'MACULA_MESH_ENABLED'},
            {i, "include"}
        ]}
    ]},
    {mesh_test, [
        {deps, [
            {macula_tweann, "~> 0.18.0"},
            {macula, {git, "https://github.com/macula-io/macula.git", {tag, "v0.14.2"}}}
        ]},
        {erl_opts, [
            debug_info,
            nowarn_export_all,
            {d, 'MACULA_MESH_ENABLED'},
            {i, "include"}
        ]},
        {extra_src_dirs, [
            "test"
        ]}
    ]}
]}.

%% Shell configuration
{shell, [
    {apps, [macula_neuroevolution]}
]}.

%% Documentation
{edoc_opts, [
    {title, "Macula Neuroevolution - Population-Based Evolutionary Training"},
    {source_path, ["src"]},
    {includes, ["include"]}
]}.

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