25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Dialyzer: Add support to run Dialyzer with Mix

This commit is contained in:
Badlop 2024-02-29 16:46:05 +01:00
parent c7f76944f3
commit f5c8406353
3 changed files with 26 additions and 3 deletions

View File

@ -577,10 +577,16 @@ Makefile: Makefile.in
#' dialyzer #' dialyzer
# #
ifeq "$(REBAR_VER)" "3" ifeq "$(REBAR_VER)" "6" # Mix
dialyzer:
MIX_ENV=test $(REBAR) dialyzer
else
ifeq "$(REBAR_VER)" "3" # Rebar3
dialyzer: dialyzer:
$(REBAR) dialyzer $(REBAR) dialyzer
else
else # Rebar2
deps := $(wildcard $(DEPSDIR)/*/ebin) deps := $(wildcard $(DEPSDIR)/*/ebin)
dialyzer/erlang.plt: dialyzer/erlang.plt:
@ -620,6 +626,7 @@ dialyzer: erlang_plt deps_plt ejabberd_plt
--get_warnings -o dialyzer/error.log ebin; \ --get_warnings -o dialyzer/error.log ebin; \
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
endif endif
endif
#. #.
#' test #' test
@ -671,7 +678,7 @@ help:
@echo " translations Extract translation files" @echo " translations Extract translation files"
@echo " TAGS Generate tags file for text editors" @echo " TAGS Generate tags file for text editors"
@echo "" @echo ""
@echo " dialyzer Run Dialyzer static analyzer [rebar3]" @echo " dialyzer Run Dialyzer static analyzer"
@echo " hooks Run hooks validator" @echo " hooks Run hooks validator"
@echo " test Run Common Tests suite [rebar3]" @echo " test Run Common Tests suite [rebar3]"
@echo " xref Run cross reference analysis [rebar3]" @echo " xref Run cross reference analysis [rebar3]"

14
mix.exs
View File

@ -16,6 +16,7 @@ defmodule Ejabberd.MixProject do
aliases: [test: "test --no-start"], aliases: [test: "test --no-start"],
start_permanent: Mix.env() == :prod, start_permanent: Mix.env() == :prod,
language: :erlang, language: :erlang,
dialyzer: dialyzer(),
releases: releases(), releases: releases(),
package: package(), package: package(),
docs: docs(), docs: docs(),
@ -52,6 +53,17 @@ defmodule Ejabberd.MixProject do
++ cond_included_apps()] ++ cond_included_apps()]
end end
defp dialyzer do
[
plt_add_apps: [
:mnesia, :odbc, :os_mon, :stdlib,
:eredis, :luerl,
:cache_tab, :eimp, :epam, :esip, :ezlib, :mqtree,
:p1_acme, :p1_mysql, :p1_oauth2, :p1_pgsql, :pkix,
:sqlite3, :stun, :xmpp],
]
end
defp if_version_above(ver, okResult) do defp if_version_above(ver, okResult) do
if :erlang.system_info(:otp_release) > ver do if :erlang.system_info(:otp_release) > ver do
okResult okResult
@ -104,6 +116,7 @@ defmodule Ejabberd.MixProject do
defp deps do defp deps do
[{:base64url, "~> 1.0"}, [{:base64url, "~> 1.0"},
{:cache_tab, "~> 1.0"}, {:cache_tab, "~> 1.0"},
{:dialyxir, "~> 1.2", only: [:test], runtime: false},
{:eimp, "~> 1.0"}, {:eimp, "~> 1.0"},
{:ex_doc, "~> 0.31", only: [:dev, :edoc], runtime: false}, {:ex_doc, "~> 0.31", only: [:dev, :edoc], runtime: false},
{:fast_tls, ">= 1.1.18"}, {:fast_tls, ">= 1.1.18"},
@ -164,6 +177,7 @@ defmodule Ejabberd.MixProject do
{config(:lua), :luerl}, {config(:lua), :luerl},
{config(:redis), :eredis}, {config(:redis), :eredis},
{Mix.env() == :edoc, :ex_doc}, {Mix.env() == :edoc, :ex_doc},
{Mix.env() == :test, :dialyxir},
{if_version_below(~c"22", true), :lager}, {if_version_below(~c"22", true), :lager},
{config(:mysql), :p1_mysql}, {config(:mysql), :p1_mysql},
{config(:sip), :esip}, {config(:sip), :esip},

View File

@ -1,10 +1,12 @@
%{ %{
"base64url": {:hex, :base64url, "1.0.1", "f8c7f2da04ca9a5d0f5f50258f055e1d699f0e8bf4cfdb30b750865368403cf6", [:rebar3], [], "hexpm", "f9b3add4731a02a9b0410398b475b33e7566a695365237a6bdee1bb447719f5c"}, "base64url": {:hex, :base64url, "1.0.1", "f8c7f2da04ca9a5d0f5f50258f055e1d699f0e8bf4cfdb30b750865368403cf6", [:rebar3], [], "hexpm", "f9b3add4731a02a9b0410398b475b33e7566a695365237a6bdee1bb447719f5c"},
"cache_tab": {:hex, :cache_tab, "1.0.30", "6d35eecfb65fbe5fc85988503a27338d32de01243f3fc8ea3ee7161af08725a4", [:rebar3], [{:p1_utils, "1.0.25", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "6d8a5e00d8f84c42627706a6dbedb02e34d58495f3ed61935c8475ca0531cda0"}, "cache_tab": {:hex, :cache_tab, "1.0.30", "6d35eecfb65fbe5fc85988503a27338d32de01243f3fc8ea3ee7161af08725a4", [:rebar3], [{:p1_utils, "1.0.25", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "6d8a5e00d8f84c42627706a6dbedb02e34d58495f3ed61935c8475ca0531cda0"},
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"}, "earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
"eimp": {:hex, :eimp, "1.0.22", "fa9b376ef0b50e8455db15c7c11dea4522c6902e04412288aab436d26335f6eb", [:rebar3], [{:p1_utils, "1.0.25", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "b3b9ffb1d9a5f4a2ba88ac418a819164932d9a9d3a2fc3d32ca338ce855c4392"}, "eimp": {:hex, :eimp, "1.0.22", "fa9b376ef0b50e8455db15c7c11dea4522c6902e04412288aab436d26335f6eb", [:rebar3], [{:p1_utils, "1.0.25", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "b3b9ffb1d9a5f4a2ba88ac418a819164932d9a9d3a2fc3d32ca338ce855c4392"},
"epam": {:hex, :epam, "1.0.14", "aa0b85d27f4ef3a756ae995179df952a0721237e83c6b79d644347b75016681a", [:rebar3], [], "hexpm", "2f3449e72885a72a6c2a843f561add0fc2f70d7a21f61456930a547473d4d989"}, "epam": {:hex, :epam, "1.0.14", "aa0b85d27f4ef3a756ae995179df952a0721237e83c6b79d644347b75016681a", [:rebar3], [], "hexpm", "2f3449e72885a72a6c2a843f561add0fc2f70d7a21f61456930a547473d4d989"},
"eredis": {:hex, :eredis, "1.2.0", "0b8e9cfc2c00fa1374cd107ea63b49be08d933df2cf175e6a89b73dd9c380de4", [:rebar3], [], "hexpm", "d9b5abef2c2c8aba8f32aa018203e0b3dc8b1157773b254ab1d4c2002317f1e1"}, "eredis": {:hex, :eredis, "1.2.0", "0b8e9cfc2c00fa1374cd107ea63b49be08d933df2cf175e6a89b73dd9c380de4", [:rebar3], [], "hexpm", "d9b5abef2c2c8aba8f32aa018203e0b3dc8b1157773b254ab1d4c2002317f1e1"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"esip": {:hex, :esip, "1.0.52", "a2840287c493a4280e6fba57a257706843b025c315875e38b03fd07190e22dba", [:rebar3], [{:fast_tls, "1.1.19", [hex: :fast_tls, repo: "hexpm", optional: false]}, {:p1_utils, "1.0.25", [hex: :p1_utils, repo: "hexpm", optional: false]}, {:stun, "1.2.12", [hex: :stun, repo: "hexpm", optional: false]}], "hexpm", "6f00165395900500aa262ce0297162d93931c78c1464d89fd0edc6e3d6bc011f"}, "esip": {:hex, :esip, "1.0.52", "a2840287c493a4280e6fba57a257706843b025c315875e38b03fd07190e22dba", [:rebar3], [{:fast_tls, "1.1.19", [hex: :fast_tls, repo: "hexpm", optional: false]}, {:p1_utils, "1.0.25", [hex: :p1_utils, repo: "hexpm", optional: false]}, {:stun, "1.2.12", [hex: :stun, repo: "hexpm", optional: false]}], "hexpm", "6f00165395900500aa262ce0297162d93931c78c1464d89fd0edc6e3d6bc011f"},
"ex_doc": {:hex, :ex_doc, "0.31.1", "8a2355ac42b1cc7b2379da9e40243f2670143721dd50748bf6c3b1184dae2089", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.1", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "3178c3a407c557d8343479e1ff117a96fd31bafe52a039079593fb0524ef61b0"}, "ex_doc": {:hex, :ex_doc, "0.31.1", "8a2355ac42b1cc7b2379da9e40243f2670143721dd50748bf6c3b1184dae2089", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.1", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "3178c3a407c557d8343479e1ff117a96fd31bafe52a039079593fb0524ef61b0"},
"ezlib": {:hex, :ezlib, "1.0.12", "ffe906ba10d03aaee7977e1e0e81d9ffc3bb8b47fb9cd8e2e453507a2e56221f", [:rebar3], [{:p1_utils, "1.0.25", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "30e94355fb42260aab6e12582cb0c56bf233515e655c8aeaf48760e7561e4ebb"}, "ezlib": {:hex, :ezlib, "1.0.12", "ffe906ba10d03aaee7977e1e0e81d9ffc3bb8b47fb9cd8e2e453507a2e56221f", [:rebar3], [{:p1_utils, "1.0.25", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "30e94355fb42260aab6e12582cb0c56bf233515e655c8aeaf48760e7561e4ebb"},