rebar.config.script 986 B

123456789101112131415161718192021222324252627282930
  1. IsCentos6 = fun() ->
  2. case file:read_file("/etc/centos-release") of
  3. {ok, <<"CentOS release 6", _/binary >>} ->
  4. true;
  5. _ ->
  6. false
  7. end
  8. end,
  9. IsWin32 = fun() ->
  10. win32 =:= element(1, os:type())
  11. end,
  12. IsQuicSupp = fun() ->
  13. not (IsCentos6() orelse IsWin32() orelse
  14. false =/= os:getenv("BUILD_WITHOUT_QUIC")
  15. )
  16. end,
  17. Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {branch, "0.6.0"}}},
  18. Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {branch, "0.0.9"}}},
  19. ExtraDeps = fun(C) ->
  20. {deps, Deps0} = lists:keyfind(deps, 1, C),
  21. Deps = Deps0 ++ [Bcrypt || not IsWin32()] ++
  22. [ Quicer || IsQuicSupp()],
  23. lists:keystore(deps, 1, C, {deps, Deps})
  24. end,
  25. ExtraDeps(CONFIG).