{port_env,
 [{"darwin", "LDFLAGS", "-framework CoreFoundation -framework CoreServices"},
  {"darwin", "CC", "clang"},
  {"darwin", "CFLAGS", "-Wno-deprecated-declarations"},
  {"freebsd", "LDFLAGS", ""},
  {"freebsd", "CC", "cc"},
  {"freebsd", "CFLAGS", ""}]
}.

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

{port_specs,
 [{"darwin", "priv/mac_listener", ["c_src/mac/*.c"]},
  {"freebsd", "priv/kqueue", ["c_src/bsd/*.c"]}
  ]}.

{plugins, [pc, rebar3_hex]}.
{provider_hooks, [
    {pre, [
        {compile, {pc, compile}},
        {clean,   {pc, clean}}
    ]}
]}.
%{pre_hooks, [
%             {"win32",  compile, "make -f c_src/windows/Makefile"},
%             {"win32",  clean,   "make -f c_src/windows/Makefile clean"}
%            ]
%}.

{project_plugins, [rebar3_format]}.
{format, [
    {files, ["src/*.erl", "test/*.erl"]},
    {formatter, otp_formatter},
    {options, #{ line_length => 108,
                 paper => 250,
                 spaces_around_fields => false,
                 inlining => all,
                 inline_clause_bodies => true,
                 inline_expressions => true,
                 inline_qualified_function_composition => true,
                 inline_simple_funs => true,
                 inline_items => all,
                 inline_fields => true,
                 inline_attributes => true
                 }}]}.
