Skip to content
Permalink
Browse files
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.
  • Loading branch information
davisp committed Feb 23, 2022
1 parent b5f3d08 commit e93c20844981a499dfb0a804bb9d892b8509b6a1
Showing 1 changed file with 12 additions and 3 deletions.
@@ -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"]},

0 comments on commit e93c208

Please sign in to comment.