{project_plugins, [rebar3_ex_doc, rebar3_hex]}.

{hex, [
    {doc, ex_doc},
    {files, [
        "src",
        "native/sied/src/lib.rs",
        "native/sied/Cargo.toml",
        "native/sied/Cargo.lock",
        "priv/sied.dll",
        "priv/sied.so",
        "priv/sied.dylib",
        "rebar.config", "Makefile", "README*", "LICENSE*"
    ]}
]}.

{ex_doc, [
    {extras, [
        {"README.md", #{title => "Overview"}},
        {"LICENSE", #{title => "License"}}
    ]},
    {main, "README.md"},
    {source_url, "https://github.com/roquess/sied"},
    {api_reference, true}
]}.

{erl_opts, [debug_info]}.

%% Automatically compile the Rust NIF on Linux/macOS if not already present.
%% On Windows the pre-built sied.dll shipped with the hex package is used.
%% Graceful: if Makefile absent (old package) or cargo missing, skip silently.
{pre_hooks, [
    {"(linux|darwin)", compile,
     "[ -f Makefile ] && make -f Makefile build_if_needed || true"}
]}.

{deps, []}.

{shell, [
    {apps, [sied]}
]}.
