-
Notifications
You must be signed in to change notification settings - Fork 151
/
BUILD.bazel
196 lines (169 loc) · 4.87 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@rules_erlang//gazelle:def.bzl", "GAZELLE_ERLANG_RUNTIME_DEPS")
load("@rules_erlang//gazelle:moduleindex.bzl", "moduleindex")
load("@rules_erlang//:erlang_bytecode2.bzl", "erlc_opts")
load("@rules_erlang//:erlang_app.bzl", "erlang_app", "test_erlang_app")
load("@rules_erlang//:xref2.bzl", "xref")
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
load("@rules_erlang//:eunit2.bzl", "eunit")
load("@rules_erlang//:ct.bzl", "assert_suites2")
load("@rules_erlang//:ez.bzl", "ez")
load(":app.bzl", "all_beam_files", "all_srcs", "all_test_beam_files", "test_suite_beam_files")
load(":helpers.bzl", "rabbitmq_integration_suite")
load("@rabbitmq-server//:rabbitmq_home.bzl", "rabbitmq_home")
load("@rabbitmq-server//:rabbitmq_run.bzl", "rabbitmq_run", "rabbitmq_run_command")
load("@rabbitmq-server//:rabbitmqctl.bzl", "rabbitmqctl")
# gazelle:exclude .github
# gazelle:exclude .elixir_ls
# gazelle:exclude .erlang.mk
# gazelle:exclude .vscode
# gazelle:erlang_skip_rules ct_test
# gazelle:erlang_generate_beam_files_macro
# gazelle:erlang_generate_fewer_bytecode_rules
# gazelle:erlang_resolve amqp_client @rabbitmq-server//deps/amqp_client:erlang_app
# gazelle:erlang_resolve amqp10_client @rabbitmq-server//deps/amqp10_client:erlang_app
# gazelle:erlang_resolve rabbit @rabbitmq-server//deps/rabbit:erlang_app
# gazelle:erlang_resolve rabbit_common @rabbitmq-server//deps/rabbit_common:erlang_app
# gazelle:erlang_resolve rabbitmq_amqp1_0 @rabbitmq-server//deps/rabbitmq_amqp1_0:erlang_app
# gazelle:erlang_resolve rabbitmq_cli @rabbitmq-server//deps/rabbitmq_cli:erlang_app
# gazelle:erlang_resolve rabbitmq_ct_helpers @rabbitmq-server//deps/rabbitmq_ct_helpers:erlang_app
gazelle(
name = "gazelle",
data = GAZELLE_ERLANG_RUNTIME_DEPS,
extra_args = [
"--app_name",
module_name(),
"--verbose",
],
gazelle = "@rules_erlang//gazelle:gazelle_erlang_binary",
)
moduleindex(
name = "moduleindex",
testonly = True,
apps = [
"@rabbitmq-server//deps/rabbit:erlang_app",
],
tags = ["manual"],
)
erlc_opts(
name = "erlc_opts",
values = select({
"@rules_erlang//:debug_build": [
"+debug_info",
],
"//conditions:default": [
"+debug_info",
"+deterministic",
],
}),
visibility = [":__subpackages__"],
)
erlc_opts(
name = "test_erlc_opts",
values = select({
"@rules_erlang//:debug_build": [
"+debug_info",
"-DTEST=1",
],
"//conditions:default": [
"+debug_info",
"+deterministic",
"-DTEST=1",
],
}),
visibility = [":__subpackages__"],
)
plt(
name = "base_plt",
visibility = [":__subpackages__"],
)
all_srcs(name = "all_srcs")
all_beam_files(name = "all_beam_files")
all_test_beam_files(name = "all_test_beam_files")
test_suite_beam_files(name = "test_suite_beam_files")
erlang_app(
name = "erlang_app",
srcs = [":all_srcs"],
hdrs = [":public_hdrs"],
app_description = "RabbitMQ Delayed Message Exchange",
app_module = "rabbit_delayed_message_app",
app_name = "rabbitmq_delayed_message_exchange",
app_version = module_version(),
beam_files = [":beam_files"],
license_files = [":license_files"],
priv = [":priv"],
deps = [
"@rabbitmq-server//deps/rabbit:erlang_app",
"@rabbitmq-server//deps/rabbit_common:erlang_app",
],
)
alias(
name = "rabbitmq_delayed_message_exchange",
actual = ":erlang_app",
visibility = ["//visibility:public"],
)
test_erlang_app(
name = "test_erlang_app",
srcs = [":all_srcs"],
hdrs = [":public_and_private_hdrs"],
app_name = "rabbitmq_delayed_message_exchange",
beam_files = [":test_beam_files"],
license_files = [":license_files"],
priv = [":priv"],
deps = [
"@rabbitmq-server//deps/rabbit:erlang_app",
"@rabbitmq-server//deps/rabbit_common:erlang_app",
],
)
xref(
name = "xref",
target = ":erlang_app",
)
plt(
name = "deps_plt",
apps = [
"mnesia", # keep
],
for_target = ":erlang_app",
plt = "//:base_plt",
)
dialyze(
name = "dialyze",
plt = ":deps_plt",
target = ":erlang_app",
)
eunit(
name = "eunit",
target = ":test_erlang_app",
)
rabbitmq_home(
name = "broker-home",
plugins = [
"@rabbitmq-server//deps/rabbit:erlang_app",
":erlang_app",
],
)
rabbitmq_run(
name = "rabbitmq-run",
home = ":broker-home",
)
# `bazel run broker`
rabbitmq_run_command(
name = "broker",
rabbitmq_run = ":rabbitmq-run",
subcommand = "run-broker",
)
# `bazel run rabbitmqctl -- export_definitons -`
rabbitmqctl(
name = "rabbitmqctl",
home = ":broker-home",
)
rabbitmq_integration_suite(
name = "plugin_SUITE",
shard_count = 2,
)
assert_suites2()
ez(
name = "ez",
app = ":erlang_app",
)