%% -*- mode: erlang -*-

%% accept R15B02.., any R16B except R16B03
%% also accept OTP v17, altough it may not work properly on that release yet..
{require_otp_vsn, "R15B0[^1]|R16B$|R16B[^0]|R16B0[^3]|R16B03-1|17|18"}.

{erl_opts, [debug_info]}.
{yrl_opts, [{includefile, "include/erlydtl_preparser.hrl"}]}.

{eunit_opts,
 [%% This turns off the default output, MUST HAVE
  no_tty,
  %% Uses the progress formatter with ANSI-colored output
  {report, {eunit_progress, [colored
                             %% uncomment to get a list of slowest running tests
                             %%, profile
                            ]}}
 ]}.

{deps,
 [{merl, ".*",
   {git, "git://github.com/erlydtl/merl.git", {branch, "erlydtl"}},
   [raw]},
  {eunit_formatters, ".*",
   {git, "git://github.com/seancribbs/eunit_formatters", {branch, "master"}}}
 ]}.

{pre_hooks,
 [{"(linux|darwin|solaris)", compile, "make -C \"$REBAR_DEPS_DIR/merl\" all -W test"},
  {"(freebsd|netbsd|openbsd)", compile, "gmake -C \"$REBAR_DEPS_DIR/merl\" all"},
  {"win32", compile, "make -C \"%REBAR_DEPS_DIR%/merl\" all -W test"},
  {eunit,
   "erlc -I include/erlydtl_preparser.hrl -o test"
   " test/erlydtl_extension_testparser.yrl"},
  {"(linux|darwin|solaris)", eunit, "make -C \"$REBAR_DEPS_DIR/merl\" test"},
  {"(freebsd|netbsd|openbsd)", eunit, "gmake -C \"$REBAR_DEPS_DIR/merl\" test"},
  {"win32", eunit, "make -C \"%REBAR_DEPS_DIR%/merl\" test"}
 ]}.