瀏覽代碼

Drop support for rebar2 as of Erlang 25.0

Erlang 25.0 removes the ability to load modules compiled prior to Erlang
22.0. This patch replaces the Jiffy's `enc` based build system with the
`rebar3` port compiler plugin for Erlang 25.0 and newer.
pc-test
Paul J. Davis 3 年之前
父節點
當前提交
4faa508758
共有 1 個文件被更改,包括 29 次插入1 次删除
  1. +29
    -1
      rebar.config.script

+ 29
- 1
rebar.config.script 查看文件

@ -17,7 +17,7 @@ Config1 = case lists:keyfind(erl_opts, 1, CONFIG) of
CONFIG ++ [{erl_opts, ErlOpts}] CONFIG ++ [{erl_opts, ErlOpts}]
end, end,
case os:type() of
Config2 = case os:type() of
{unix, _} -> {unix, _} ->
CC = case os:getenv("CC") of CC = case os:getenv("CC") of
false -> "cc"; false -> "cc";
@ -36,4 +36,32 @@ case os:type() of
end; end;
_ -> _ ->
Config1 Config1
end,
IsRebar3 = code:which(rebar3) /= non_existing,
OTPRel = erlang:system_info(otp_release),
OTPVsn = case re:run(OTPRel, "R?(\\d+)", [{capture, all_but_first, list}]) of
{match, [V]} -> list_to_integer(V);
nomatch -> erlang:error(unknown_otp_release)
end,
case OTPVsn < 25 of
true ->
Config2;
false when IsRebar3 ->
Config3 = lists:keydelete(pre_hooks, 1, Config2),
Config4 = lists:keydelete(post_hooks, 1, Config3),
Config4 ++ [
{plugins, [{pc, "~> 1.0"}]},
{artifacts, ["priv/jiffy.so"]},
{provider_hooks, [
{post, [
{compile, {pc, compile}},
{clean, {pc, clean}}
]}
]}
];
false ->
io:format("Rebar 2 is no longer supported as of Erlang 25.0~n", []),
halt(1)
end. end.

Loading…
取消
儲存