Browse Source

Fix builds using mix as a build tool

This subtly changes the default config to a rebar3 style config that can
be used by non-rebar build tools like mix. Only on a positive test for
rebar2 do we avoid adding the port_compiler plugin and related options.
fix-mix-build
Paul J. Davis 3 years ago
parent
commit
e93c208449
1 changed files with 12 additions and 3 deletions
  1. +12
    -3
      rebar.config.script

+ 12
- 3
rebar.config.script View File

@ -38,11 +38,20 @@ Config2 = case os:type() of
Config1
end,
IsRebar3 = code:which(rebar3) /= non_existing,
case IsRebar3 of
IsRebar2 = case lists:keyfind(rebar, 1, application:loaded_applications()) of
{rebar, _Desc, Vsn} ->
case string:split(Vsn, ".") of
["2" | _] -> true;
_ -> false
end;
false ->
Config2;
false
end,
case IsRebar2 of
true ->
Config2;
false ->
Config2 ++ [
{plugins, [{pc, "~> 1.0"}]},
{artifacts, ["priv/jiffy.so"]},

Loading…
Cancel
Save