IsRebar3 = case application:get_key(rebar, vsn) of
               {ok, VSN} ->
                   [VSN1 | _] = string:tokens(VSN, "-"),
                   [Maj, Min, Patch] = string:tokens(VSN1, "."),
                   (list_to_integer(Maj) >= 3);
               undefined ->
                   lists:keymember(mix, 1, application:loaded_applications())
           end,

Rebar2Deps = [
    {jsx, ".*", {git, "https://github.com/talentdeficit/jsx.git",
                 {tag,"2.8.0"}}},

    {hackney, ".*", {git, "https://github.com/benoitc/hackney.git",
                     {tag, "1.4.4"}}}
],

case IsRebar3 of
    true ->
        CONFIG;
    false ->
        CONFIG1 = lists:keyreplace(deps, 1, CONFIG, {deps, Rebar2Deps}),
        [{eunit_opts, [verbose]} | CONFIG1]
end.
