Skip to content

Commit 19ff89f

Browse files
committed
Merge branch 'bazel-dialyze'
(cherry picked from commit c3c9b3f)
1 parent 7b126e4 commit 19ff89f

File tree

44 files changed

+460
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+460
-42
lines changed

BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@bazel-erlang//:dialyze.bzl", "plt")
12
load("elixir_home.bzl", "elixir_home")
23
load(":rabbitmq_home.bzl", "rabbitmq_home")
34
load(":rabbitmq_run.bzl", "rabbitmq_run", "rabbitmq_run_command")
@@ -42,6 +43,11 @@ platform(
4243
},
4344
)
4445

46+
plt(
47+
name = "base_plt",
48+
visibility = ["//visibility:public"],
49+
)
50+
4551
rabbitmq_home(
4652
name = "broker-home",
4753
plugins = [

deps/amqp10_client/BUILD.bazel

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
23
load("@bazel-erlang//:ct.bzl", "ct_suite")
34
load("//:rabbitmq_home.bzl", "rabbitmq_home")
45
load("//:rabbitmq_run.bzl", "rabbitmq_run")
@@ -41,6 +42,17 @@ rabbitmq_lib(
4142

4243
xref(tags = ["xref"])
4344

45+
plt(
46+
name = "base_plt",
47+
apps = EXTRA_APPS,
48+
plt = "//:base_plt",
49+
)
50+
51+
dialyze(
52+
plt = ":base_plt",
53+
tags = ["dialyze"],
54+
)
55+
4456
rabbitmq_suite(
4557
name = "msg_SUITE",
4658
deps = DEPS,

deps/amqp10_common/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ load(
55
"erlc",
66
)
77
load("@bazel-erlang//:xref.bzl", "xref")
8+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
89
load("@bazel-erlang//:ct.bzl", "ct_suite")
910
load(
1011
"//:rabbitmq.bzl",
@@ -100,6 +101,11 @@ bazel_erlang_lib(
100101

101102
xref(tags = ["xref"])
102103

104+
dialyze(
105+
plt = "//:base_plt",
106+
tags = ["dialyze"],
107+
)
108+
103109
ct_suite(
104110
name = "binary_generator_SUITE",
105111
erlc_opts = RABBITMQ_TEST_ERLC_OPTS,

deps/amqp_client/BUILD.bazel

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
23
load("@bazel-erlang//:ct.bzl", "ct_suite")
34
load("//:rabbitmq_home.bzl", "rabbitmq_home")
45
load("//:rabbitmq_run.bzl", "rabbitmq_run")
@@ -15,6 +16,10 @@ APP_ENV = """[
1516
{writer_gc_threshold, 1000000000}
1617
]"""
1718

19+
EXTRA_APPS = [
20+
"xmerl",
21+
]
22+
1823
DEPS = [
1924
"//deps/rabbit_common:bazel_erlang_lib",
2025
"@lager//:bazel_erlang_lib",
@@ -28,9 +33,7 @@ rabbitmq_lib(
2833
app_registered = [
2934
"amqp_sup",
3035
],
31-
extra_apps = [
32-
"xmerl",
33-
],
36+
extra_apps = EXTRA_APPS,
3437
first_srcs = [
3538
"src/amqp_gen_connection.erl",
3639
"src/amqp_gen_consumer.erl",
@@ -40,6 +43,17 @@ rabbitmq_lib(
4043

4144
xref(tags = ["xref"])
4245

46+
plt(
47+
name = "base_plt",
48+
apps = EXTRA_APPS,
49+
plt = "//:base_plt",
50+
)
51+
52+
dialyze(
53+
plt = ":base_plt",
54+
tags = ["dialyze"],
55+
)
56+
4357
rabbitmq_home(
4458
name = "broker-for-tests-home",
4559
plugins = [

deps/rabbit/BUILD.bazel

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
load("@bazel-erlang//:bazel_erlang_lib.bzl", "erlc")
22
load("@bazel-erlang//:xref.bzl", "xref")
3+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
34
load("//:rabbitmq_home.bzl", "rabbitmq_home")
45
load("//:rabbitmq_run.bzl", "rabbitmq_run")
56
load(
67
"//:rabbitmq.bzl",
8+
"RABBITMQ_DIALYZER_OPTS",
79
"RABBITMQ_ERLC_OPTS",
810
"RABBITMQ_TEST_ERLC_OPTS",
911
"rabbitmq_integration_suite",
@@ -207,6 +209,20 @@ rabbitmq_lib(
207209

208210
xref(tags = ["xref"])
209211

212+
plt(
213+
name = "base_plt",
214+
apps = [
215+
"mnesia",
216+
] + EXTRA_APPS,
217+
plt = "//:base_plt",
218+
)
219+
220+
dialyze(
221+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
222+
plt = ":base_plt",
223+
tags = ["dialyze"],
224+
)
225+
210226
bats(
211227
srcs = glob(["test/**/*.bats"]),
212228
data = glob(
Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
load("@bazel-erlang//:bazel_erlang_lib.bzl", "erlang_lib", "test_erlang_lib")
2-
load(
3-
"//:rabbitmq.bzl",
4-
"RABBITMQ_ERLC_OPTS",
5-
"RABBITMQ_TEST_ERLC_OPTS",
6-
)
1+
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
3+
load("//:rabbitmq.bzl", "APP_VERSION", "rabbitmq_lib")
74

85
APP_NAME = "rabbitmq_prelaunch"
96

@@ -13,26 +10,24 @@ APP_DESCRIPTION = "RabbitMQ prelaunch setup"
1310

1411
APP_MODULE = "rabbit_prelaunch_app"
1512

16-
erlang_lib(
13+
DEPS = [
14+
"//deps/rabbit_common:bazel_erlang_lib",
15+
"@lager//:bazel_erlang_lib",
16+
]
17+
18+
rabbitmq_lib(
1719
app_description = APP_DESCRIPTION,
1820
app_module = APP_MODULE,
1921
app_name = APP_NAME,
2022
app_version = APP_VERSION,
21-
erlc_opts = RABBITMQ_ERLC_OPTS,
22-
deps = [
23-
"//deps/rabbit_common:bazel_erlang_lib",
24-
"@lager//:bazel_erlang_lib",
25-
],
23+
deps = DEPS,
2624
)
2725

28-
test_erlang_lib(
29-
app_description = APP_DESCRIPTION,
30-
app_module = APP_MODULE,
31-
app_name = APP_NAME,
32-
app_version = APP_VERSION,
33-
erlc_opts = RABBITMQ_TEST_ERLC_OPTS,
34-
deps = [
35-
"//deps/rabbit_common:test_bazel_erlang_lib",
36-
"@lager//:bazel_erlang_lib",
37-
],
26+
xref(
27+
tags = ["xref"],
28+
)
29+
30+
dialyze(
31+
plt = "//:base_plt",
32+
tags = ["dialyze"],
3833
)

deps/rabbit_common/BUILD.bazel

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load("@bazel-erlang//:bazel_erlang_lib.bzl", "app_file", "bazel_erlang_lib", "erlc")
22
load("@bazel-erlang//:xref.bzl", "xref")
3+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
34
load("@bazel-erlang//:ct.bzl", "ct_test")
45
load("//:rabbitmq.bzl", "APP_VERSION", "RABBITMQ_ERLC_OPTS", "RABBITMQ_TEST_ERLC_OPTS")
56

@@ -59,23 +60,25 @@ RUNTIME_DEPS = [
5960

6061
APP_NAME = "rabbit_common"
6162

63+
EXTRA_APPS = [
64+
"compiler",
65+
"crypto",
66+
"public_key",
67+
"sasl",
68+
"ssl",
69+
"syntax_tools",
70+
"tools",
71+
"xmerl",
72+
]
73+
6274
HDRS = glob(["include/*.hrl"]) + ["include/rabbit_framing.hrl"]
6375

6476
app_file(
6577
name = "app_file",
6678
app_description = "Modules shared by rabbitmq-server and rabbitmq-erlang-client",
6779
app_name = APP_NAME,
6880
app_version = APP_VERSION,
69-
extra_apps = [
70-
"compiler",
71-
"crypto",
72-
"public_key",
73-
"sasl",
74-
"ssl",
75-
"syntax_tools",
76-
"tools",
77-
"xmerl",
78-
],
81+
extra_apps = EXTRA_APPS,
7982
modules = [":beam_files"],
8083
deps = DEPS + RUNTIME_DEPS,
8184
)
@@ -168,6 +171,21 @@ bazel_erlang_lib(
168171

169172
xref(tags = ["xref"])
170173

174+
plt(
175+
name = "base_plt",
176+
apps = [
177+
"mnesia",
178+
"crypto",
179+
"ssl",
180+
] + EXTRA_APPS,
181+
plt = "//:base_plt",
182+
)
183+
184+
dialyze(
185+
plt = ":base_plt",
186+
tags = ["dialyze"],
187+
)
188+
171189
erlc(
172190
name = "rabbit_env_SUITE_beam_files",
173191
testonly = True,

deps/rabbitmq_amqp1_0/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
23
load(
34
"//:rabbitmq.bzl",
5+
"RABBITMQ_DIALYZER_OPTS",
46
"broker_for_integration_suites",
57
"rabbitmq_integration_suite",
68
"rabbitmq_lib",
@@ -43,6 +45,12 @@ rabbitmq_lib(
4345

4446
xref(tags = ["xref"])
4547

48+
dialyze(
49+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
50+
plt = "//:base_plt",
51+
tags = ["dialyze"],
52+
)
53+
4654
broker_for_integration_suites()
4755

4856
PACKAGE = "deps/rabbitmq_amqp1_0"

deps/rabbitmq_auth_backend_cache/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
23
load(
34
"//:rabbitmq.bzl",
5+
"RABBITMQ_DIALYZER_OPTS",
46
"broker_for_integration_suites",
57
"rabbitmq_integration_suite",
68
"rabbitmq_lib",
@@ -50,6 +52,12 @@ rabbitmq_lib(
5052

5153
xref(tags = ["xref"])
5254

55+
dialyze(
56+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
57+
plt = "//:base_plt",
58+
tags = ["dialyze"],
59+
)
60+
5361
broker_for_integration_suites()
5462

5563
PACKAGE = "deps/rabbitmq_auth_backend_cache"

deps/rabbitmq_auth_backend_http/BUILD.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
23
load("@bazel-erlang//:ct.bzl", "ct_suite")
34
load(
45
"//:rabbitmq.bzl",
6+
"RABBITMQ_DIALYZER_OPTS",
57
"broker_for_integration_suites",
68
"rabbitmq_integration_suite",
79
"rabbitmq_lib",
@@ -52,6 +54,18 @@ rabbitmq_lib(
5254

5355
xref(tags = ["xref"])
5456

57+
plt(
58+
name = "base_plt",
59+
apps = EXTRA_APPS,
60+
plt = "//:base_plt",
61+
)
62+
63+
dialyze(
64+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
65+
plt = ":base_plt",
66+
tags = ["dialyze"],
67+
)
68+
5569
broker_for_integration_suites()
5670

5771
PACKAGE = "deps/rabbitmq_auth_backend_http"

deps/rabbitmq_auth_backend_ldap/BUILD.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
23
load("//:rabbitmq_home.bzl", "rabbitmq_home")
34
load("//:rabbitmq_run.bzl", "rabbitmq_run")
45
load(
56
"//:rabbitmq.bzl",
7+
"RABBITMQ_DIALYZER_OPTS",
68
"broker_for_integration_suites",
79
"rabbitmq_integration_suite",
810
"rabbitmq_lib",
@@ -68,6 +70,18 @@ rabbitmq_lib(
6870

6971
xref(tags = ["xref"])
7072

73+
plt(
74+
name = "base_plt",
75+
apps = EXTRA_APPS,
76+
plt = "//:base_plt",
77+
)
78+
79+
dialyze(
80+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
81+
plt = ":base_plt",
82+
tags = ["dialyze"],
83+
)
84+
7185
broker_for_integration_suites()
7286

7387
PACKAGE = "deps/rabbitmq_auth_backend_ldap"

deps/rabbitmq_auth_backend_oauth2/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
load("@bazel-erlang//:bazel_erlang_lib.bzl", "erlc")
22
load("@bazel-erlang//:xref.bzl", "xref")
3+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
34
load(
45
"//:rabbitmq.bzl",
6+
"RABBITMQ_DIALYZER_OPTS",
57
"RABBITMQ_TEST_ERLC_OPTS",
68
"broker_for_integration_suites",
79
"rabbitmq_integration_suite",
@@ -39,6 +41,12 @@ rabbitmq_lib(
3941

4042
xref(tags = ["xref"])
4143

44+
dialyze(
45+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
46+
plt = "//:base_plt",
47+
tags = ["dialyze"],
48+
)
49+
4250
broker_for_integration_suites()
4351

4452
erlc(

0 commit comments

Comments
 (0)