Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed rebar2 case in rebar.config.script #175

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions rebar.config.script
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
IsRebar3 = case application:get_key(rebar, vsn) of
{ok, Vsn} ->
[MajorVersion|_] = string:tokens(Vsn, "."),
(list_to_integer(MajorVersion) >= 3);
undefined ->
false
end,
NoDialWarns = {dialyzer, [{warnings, [no_unknown]}]},
OTPRelease = erlang:list_to_integer(erlang:system_info(otp_release)),

Rebar2Deps = [
{cf, ".*", {git, "https://github.com/project-fifo/cf", {tag, "0.2.2"}}}
],

NoDialWarns = {dialyzer, [{warnings, [no_unknown]}]},
OTPRelease = erlang:list_to_integer(erlang:system_info(otp_release)),
WarnsRemoved = case OTPRelease<26 of
true -> fun(Config) -> Config end;
false -> fun(Config) -> lists:keystore(dialyzer, 1, Config, NoDialWarns) end
end,

case IsRebar3 of
true -> WarnsRemoved(CONFIG);
false ->
lists:keyreplace(deps, 1, WarnsRemoved(CONFIG), {deps, Rebar2Deps})
case OTPRelease<26 of
true -> CONFIG;
false -> lists:keystore(dialyzer, 1, CONFIG, NoDialWarns)
end.
Loading