1 Star 16 Fork 5

EMQX / emqtt

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
rebar.config.script 2.34 KB
一键复制 编辑 原始数据 按行查看 历史
William Yang 提交于 2023-12-05 10:29 . bump quicer 0.0.307
%%-*- mode: erlang -*-
%% ==============================================================================
%% Relx configs
%% ==============================================================================
Keyfind = fun(K, L) -> {K, V} = lists:keyfind(K, 1, L), V end,
IsCentos6 = fun() ->
case file:read_file("/etc/centos-release") of
{ok, <<"CentOS release 6", _/binary >>} ->
true;
_ ->
false
end
end,
IsWin32 = fun() ->
win32 =:= element(1, os:type())
end,
IsQuicSupp = fun() ->
not (IsCentos6() orelse IsWin32()
orelse false =/= os:getenv("BUILD_WITHOUT_QUIC")
)
end,
NewRelx =
fun(Name, Profiles) ->
EMQTT = Keyfind(Name, Profiles),
Relx = Keyfind(relx, EMQTT),
{release, {emqtt, Vsn}, Apps} = lists:keyfind(release, 1, Relx),
GitDescribe = lists:last(string:tokens(os:cmd("git describe --tags --always"), "\n")),
lists:keystore(release, 1, Relx, {release, {emqtt, GitDescribe},
Apps ++ [ {quicer, load} || IsQuicSupp() ]})
end,
Profiles = Keyfind(profiles, CONFIG),
NewProfiles = lists:foldl(fun(Key, Acc) ->
{Key, Old} = lists:keyfind(Key, 1, Acc),
New = lists:keystore(relx, 1, Old, {relx, NewRelx(Key, Acc)}),
lists:keystore(Key, 1, Acc, {Key, New})
end, Profiles, [emqtt, emqtt_pkg, emqtt_relup_test]),
NewConfig = lists:keystore(profiles, 1, CONFIG, {profiles, NewProfiles}),
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.307"}}},
KillQuicer = fun(C) ->
{deps, Deps0} = lists:keyfind(deps, 1, C),
{erl_opts, ErlOpts0} = lists:keyfind(erl_opts, 1, C),
IsQuic = IsQuicSupp(),
New = [ {deps, Deps0 ++ [ Quicer || IsQuic ]}
, {erl_opts, ErlOpts0 ++ [ {d, 'BUILD_WITHOUT_QUIC'} || not IsQuic ]}
],
lists:foldl(fun({Key, _Val} = KV, Acc) ->
lists:keystore(Key, 1, Acc, KV)
end, C, New)
end,
KillQuicer(NewConfig).
Erlang
1
https://gitee.com/emqx/emqtt.git
git@gitee.com:emqx/emqtt.git
emqx
emqtt
emqtt
master

搜索帮助