Skip to content

Commit d8451f3

Browse files
GEnerate Bazel files
1 parent 758e1b8 commit d8451f3

File tree

3 files changed

+63
-68
lines changed

3 files changed

+63
-68
lines changed
Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,22 @@
11
load("@rules_erlang//:xref2.bzl", "xref")
22
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
3-
load(
4-
"//:rabbitmq.bzl",
5-
"RABBITMQ_DIALYZER_OPTS",
6-
"assert_suites",
7-
"rabbitmq_app",
8-
)
9-
load(
10-
":app.bzl",
11-
"all_beam_files",
12-
"all_srcs",
13-
"all_test_beam_files",
14-
"test_suite_beam_files",
15-
)
16-
17-
APP_NAME = "rabbitmq_local_exchange"
3+
load("@rules_erlang//:eunit2.bzl", "eunit")
4+
load(":app.bzl", "all_beam_files", "all_srcs", "all_test_beam_files", "test_suite_beam_files")
5+
load("//:rabbitmq.bzl", "assert_suites", "rabbitmq_app")
186

19-
APP_DESCRIPTION = "RabbitMQ Local Exchange"
7+
all_srcs(name = "all_srcs")
208

219
all_beam_files(name = "all_beam_files")
2210

2311
all_test_beam_files(name = "all_test_beam_files")
2412

25-
all_srcs(name = "all_srcs")
26-
2713
test_suite_beam_files(name = "test_suite_beam_files")
2814

2915
rabbitmq_app(
3016
name = "erlang_app",
3117
srcs = [":all_srcs"],
3218
hdrs = [":public_hdrs"],
33-
app_description = APP_DESCRIPTION,
34-
app_name = APP_NAME,
19+
app_name = "rabbitmq_local_exchange",
3520
beam_files = [":beam_files"],
3621
license_files = [":license_files"],
3722
priv = [":priv"],
@@ -41,6 +26,12 @@ rabbitmq_app(
4126
],
4227
)
4328

29+
alias(
30+
name = "rabbitmq_local_exchange",
31+
actual = ":erlang_app",
32+
visibility = ["//visibility:public"],
33+
)
34+
4435
xref(
4536
name = "xref",
4637
target = ":erlang_app",
@@ -49,19 +40,18 @@ xref(
4940
plt(
5041
name = "deps_plt",
5142
for_target = ":erlang_app",
52-
ignore_warnings = True,
5343
plt = "//:base_plt",
5444
)
5545

5646
dialyze(
5747
name = "dialyze",
58-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
5948
plt = ":deps_plt",
6049
target = ":erlang_app",
6150
)
6251

63-
alias(
64-
name = "rabbitmq_local_exchange",
65-
actual = ":erlang_app",
66-
visibility = ["//visibility:public"],
52+
eunit(
53+
name = "eunit",
54+
target = ":test_erlang_app",
6755
)
56+
57+
assert_suites()
Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,76 @@
11
load("@rules_erlang//:erlang_bytecode2.bzl", "erlang_bytecode")
22
load("@rules_erlang//:filegroup.bzl", "filegroup")
33

4-
def all_beam_files(name = "all_beam_files"):
4+
def all_srcs(name = "all_srcs"):
55
filegroup(
6-
name = "beam_files",
7-
srcs = [":other_beam"],
8-
)
9-
erlang_bytecode(
10-
name = "other_beam",
11-
srcs = ["src/rabbit_exchange_type_local.erl"],
12-
hdrs = [":public_and_private_hdrs"],
13-
app_name = "rabbitmq_local_exchange",
14-
dest = "ebin",
15-
erlc_opts = "//:erlc_opts",
16-
deps = [
17-
"//deps/rabbit:erlang_app",
18-
"//deps/rabbit_common:erlang_app",
6+
name = "srcs",
7+
srcs = [
8+
"src/rabbit_exchange_type_local.erl",
199
],
2010
)
21-
22-
def all_srcs(name = "all_srcs"):
11+
filegroup(name = "private_hdrs")
12+
filegroup(name = "public_hdrs")
13+
filegroup(name = "priv")
2314
filegroup(
24-
name = "all_srcs",
25-
srcs = [":public_and_private_hdrs", ":srcs"],
15+
name = "license_files",
16+
srcs = [
17+
"LICENSE",
18+
"LICENSE-APACHE2",
19+
"LICENSE-MPL-RabbitMQ",
20+
],
2621
)
2722
filegroup(
2823
name = "public_and_private_hdrs",
2924
srcs = [":private_hdrs", ":public_hdrs"],
3025
)
31-
3226
filegroup(
33-
name = "priv",
27+
name = "all_srcs",
28+
srcs = [":public_and_private_hdrs", ":srcs"],
3429
)
3530

36-
filegroup(
37-
name = "srcs",
38-
srcs = ["src/rabbit_exchange_type_local.erl"],
39-
)
40-
filegroup(
41-
name = "private_hdrs",
42-
)
43-
filegroup(
44-
name = "public_hdrs",
45-
)
46-
filegroup(
47-
name = "license_files",
31+
def all_beam_files(name = "all_beam_files"):
32+
erlang_bytecode(
33+
name = "other_beam",
4834
srcs = [
49-
"LICENSE",
50-
"LICENSE-APACHE2",
51-
"LICENSE-MPL-RabbitMQ",
35+
"src/rabbit_exchange_type_local.erl",
5236
],
37+
hdrs = [":public_and_private_hdrs"],
38+
app_name = "rabbitmq_local_exchange",
39+
dest = "ebin",
40+
erlc_opts = "//:erlc_opts",
41+
deps = ["//deps/rabbit:erlang_app", "//deps/rabbit_common:erlang_app"],
5342
)
54-
55-
def all_test_beam_files(name = "all_test_beam_files"):
5643
filegroup(
57-
name = "test_beam_files",
58-
testonly = True,
59-
srcs = [":test_other_beam"],
44+
name = "beam_files",
45+
srcs = [":other_beam"],
6046
)
47+
48+
def all_test_beam_files(name = "all_test_beam_files"):
6149
erlang_bytecode(
6250
name = "test_other_beam",
6351
testonly = True,
64-
srcs = ["src/rabbit_exchange_type_local.erl"],
52+
srcs = [
53+
"src/rabbit_exchange_type_local.erl",
54+
],
6555
hdrs = [":public_and_private_hdrs"],
6656
app_name = "rabbitmq_local_exchange",
6757
dest = "test",
6858
erlc_opts = "//:test_erlc_opts",
6959
deps = ["//deps/rabbit:erlang_app", "//deps/rabbit_common:erlang_app"],
7060
)
61+
filegroup(
62+
name = "test_beam_files",
63+
testonly = True,
64+
srcs = [":test_other_beam"],
65+
)
7166

7267
def test_suite_beam_files(name = "test_suite_beam_files"):
73-
pass
68+
erlang_bytecode(
69+
name = "rabbit_local_exchange_SUITE_beam_files",
70+
testonly = True,
71+
srcs = ["test/rabbit_local_exchange_SUITE.erl"],
72+
outs = ["test/rabbit_local_exchange_SUITE.beam"],
73+
app_name = "rabbitmq_local_exchange",
74+
erlc_opts = "//:test_erlc_opts",
75+
deps = ["//deps/amqp_client:erlang_app"],
76+
)

moduleindex.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,8 @@ rabbitmq_jms_topic_exchange:
833833
- rabbit_db_jms_exchange
834834
- rabbit_jms_topic_exchange
835835
- sjx_evaluator
836+
rabbitmq_local_exchange:
837+
- rabbit_exchange_type_local
836838
rabbitmq_management:
837839
- rabbit_mgmt_app
838840
- rabbit_mgmt_cors

0 commit comments

Comments
 (0)