瀏覽代碼

WIP: Allow rebar2 when compiled correctly

pc-test
Paul J. Davis 3 年之前
父節點
當前提交
75cafb4166
共有 2 個文件被更改,包括 10 次插入13 次删除
  1. +0
    -3
      rebar.config
  2. +10
    -10
      rebar.config.script

+ 0
- 3
rebar.config 查看文件

@ -35,6 +35,3 @@
{eunit_opts, [
verbose
]}.
{pre_hooks, [{"", compile, "escript enc compile"}]}.
{post_hooks, [{"", clean, "escript enc clean"}]}.

+ 10
- 10
rebar.config.script 查看文件

@ -45,13 +45,16 @@ OTPVsn = case re:run(OTPRel, "R?(\\d+)", [{capture, all_but_first, list}]) of
nomatch -> erlang:error(unknown_otp_release)
end,
case OTPVsn < 25 of
true ->
case {IsRebar3, OTPVsn} of
{false, _} ->
Config2;
false when IsRebar3 ->
Config3 = lists:keydelete(pre_hooks, 1, Config2),
Config4 = lists:keydelete(post_hooks, 1, Config3),
Config4 ++ [
{true, Vsn} when Vsn < 25 ->
Config2 ++ [
{pre_hooks, [{"", compile, "escript enc compile"}]},
{post_hooks, [{"", clean, "escript enc clean"}]}
];
{true, Vsn} when Vsn >= 25 ->
Config2 ++ [
{plugins, [{pc, "~> 1.0"}]},
{artifacts, ["priv/jiffy.so"]},
{provider_hooks, [
@ -60,8 +63,5 @@ case OTPVsn < 25 of
{clean, {pc, clean}}
]}
]}
];
false ->
io:format("Rebar 2 is no longer supported as of Erlang 25.0~n", []),
halt(1)
]
end.

Loading…
取消
儲存