summaryrefslogtreecommitdiff
path: root/deps/rabbitmq_peer_discovery_aws
diff options
context:
space:
mode:
authorRin Kuryloski <kuryloskip@vmware.com>2023-02-23 14:47:41 +0100
committerRin Kuryloski <kuryloskip@vmware.com>2023-04-17 18:13:18 +0200
commit8de8f59d47ef00c077ec53ad7a0ee5610cfdf746 (patch)
tree5d57b0089aca4fe7316a5ba6ef62648e8c715303 /deps/rabbitmq_peer_discovery_aws
parente50746938704dca0400528a89f0e05bf08b6d7f5 (diff)
downloadrabbitmq-server-git-8de8f59d47ef00c077ec53ad7a0ee5610cfdf746.tar.gz
Use gazelle generated bazel files
Bazel build files are now maintained primarily with `bazel run gazelle`. This will analyze and merge changes into the build files as necessitated by certain code changes (e.g. the introduction of new modules). In some cases there hints to gazelle in the build files, such as `# gazelle:erlang...` or `# keep` comments. xref checks on plugins that depend on the cli are a good example.
Diffstat (limited to 'deps/rabbitmq_peer_discovery_aws')
-rw-r--r--deps/rabbitmq_peer_discovery_aws/BUILD.bazel70
-rw-r--r--deps/rabbitmq_peer_discovery_aws/app.bzl101
2 files changed, 148 insertions, 23 deletions
diff --git a/deps/rabbitmq_peer_discovery_aws/BUILD.bazel b/deps/rabbitmq_peer_discovery_aws/BUILD.bazel
index 96023b5b25..f5bc80aece 100644
--- a/deps/rabbitmq_peer_discovery_aws/BUILD.bazel
+++ b/deps/rabbitmq_peer_discovery_aws/BUILD.bazel
@@ -1,3 +1,4 @@
+load("@rules_erlang//:eunit2.bzl", "eunit")
load("@rules_erlang//:xref2.bzl", "xref")
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
load(
@@ -9,46 +10,69 @@ load(
"rabbitmq_integration_suite",
"rabbitmq_suite",
)
+load(
+ ":app.bzl",
+ "all_beam_files",
+ "all_srcs",
+ "all_test_beam_files",
+ "test_suite_beam_files",
+)
APP_NAME = "rabbitmq_peer_discovery_aws"
APP_DESCRIPTION = "AWS-based RabbitMQ peer discovery backend"
-EXTRA_APPS = [
- "inets",
-]
+all_beam_files(name = "all_beam_files")
+
+all_test_beam_files(name = "all_test_beam_files")
-DEPS = [
- "//deps/rabbit_common:erlang_app",
- "//deps/rabbitmq_peer_discovery_common:erlang_app",
-]
+all_srcs(name = "all_srcs")
-RUNTIME_DEPS = [
- "//deps/rabbitmq_aws:erlang_app",
- "//deps/rabbit:erlang_app",
-]
+test_suite_beam_files(name = "test_suite_beam_files")
+
+# gazelle:erlang_app_extra_app inets
rabbitmq_app(
+ name = "erlang_app",
+ srcs = [":all_srcs"],
+ hdrs = [":public_hdrs"],
app_description = APP_DESCRIPTION,
app_name = APP_NAME,
- extra_apps = EXTRA_APPS,
- runtime_deps = RUNTIME_DEPS,
- deps = DEPS,
+ beam_files = [":beam_files"],
+ extra_apps = ["inets"],
+ license_files = [":license_files"],
+ priv = [":priv"],
+ deps = [
+ "//deps/rabbit:erlang_app",
+ "//deps/rabbit_common:erlang_app",
+ "//deps/rabbitmq_aws:erlang_app",
+ "//deps/rabbitmq_peer_discovery_common:erlang_app",
+ ],
)
-xref()
+xref(
+ name = "xref",
+ target = ":erlang_app",
+)
plt(
- name = "base_plt",
- apps = EXTRA_APPS,
- plt = "//:base_plt",
- deps = DEPS + RUNTIME_DEPS,
+ name = "deps_plt",
+ for_target = ":erlang_app",
ignore_warnings = True,
+ plt = "//:base_plt",
)
dialyze(
+ name = "dialyze",
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
- plt = ":base_plt",
+ plt = ":deps_plt",
+ target = ":erlang_app",
+)
+
+eunit(
+ name = "eunit",
+ compiled_suites = [":test_aws_ecs_util_beam"],
+ target = ":test_erlang_app",
)
broker_for_integration_suites()
@@ -66,8 +90,8 @@ rabbitmq_integration_suite(
rabbitmq_suite(
name = "integration_SUITE",
size = "large",
- additional_srcs = [
- "test/aws_ecs_util.erl",
+ additional_beam = [
+ "test/aws_ecs_util.beam",
],
tags = [
"aws",
@@ -81,7 +105,7 @@ rabbitmq_suite(
rabbitmq_suite(
name = "unit_SUITE",
size = "small",
- runtime_deps = [
+ deps = [
"@meck//:erlang_app",
],
)
diff --git a/deps/rabbitmq_peer_discovery_aws/app.bzl b/deps/rabbitmq_peer_discovery_aws/app.bzl
new file mode 100644
index 0000000000..782459aad0
--- /dev/null
+++ b/deps/rabbitmq_peer_discovery_aws/app.bzl
@@ -0,0 +1,101 @@
+load("@rules_erlang//:erlang_bytecode2.bzl", "erlang_bytecode")
+load("@rules_erlang//:filegroup.bzl", "filegroup")
+
+def all_beam_files(name = "all_beam_files"):
+ filegroup(
+ name = "beam_files",
+ srcs = [":other_beam"],
+ )
+ erlang_bytecode(
+ name = "other_beam",
+ srcs = native.glob(["src/**/*.erl"]),
+ hdrs = [":public_and_private_hdrs"],
+ app_name = "rabbitmq_peer_discovery_aws",
+ dest = "ebin",
+ erlc_opts = "//:erlc_opts",
+ deps = ["//deps/rabbit_common:erlang_app", "//deps/rabbitmq_peer_discovery_common:erlang_app"],
+ )
+
+def all_test_beam_files(name = "all_test_beam_files"):
+ filegroup(
+ name = "test_beam_files",
+ testonly = True,
+ srcs = [":test_other_beam"],
+ )
+ erlang_bytecode(
+ name = "test_other_beam",
+ testonly = True,
+ srcs = native.glob(["src/**/*.erl"]),
+ hdrs = [":public_and_private_hdrs"],
+ app_name = "rabbitmq_peer_discovery_aws",
+ dest = "test",
+ erlc_opts = "//:test_erlc_opts",
+ deps = ["//deps/rabbit_common:erlang_app", "//deps/rabbitmq_peer_discovery_common:erlang_app"],
+ )
+
+def all_srcs(name = "all_srcs"):
+ filegroup(
+ name = "all_srcs",
+ srcs = [":public_and_private_hdrs", ":srcs"],
+ )
+ filegroup(
+ name = "public_and_private_hdrs",
+ srcs = [":private_hdrs", ":public_hdrs"],
+ )
+
+ filegroup(
+ name = "priv",
+ srcs = native.glob(["priv/**/*"]),
+ )
+ filegroup(
+ name = "public_hdrs",
+ srcs = native.glob(["include/**/*.hrl"]),
+ )
+
+ filegroup(
+ name = "srcs",
+ srcs = native.glob([
+ "src/**/*.app.src",
+ "src/**/*.erl",
+ ]),
+ )
+ filegroup(
+ name = "private_hdrs",
+ srcs = native.glob(["src/**/*.hrl"]),
+ )
+ filegroup(
+ name = "license_files",
+ srcs = native.glob(["LICENSE*"]),
+ )
+
+def test_suite_beam_files(name = "test_suite_beam_files"):
+ erlang_bytecode(
+ name = "config_schema_SUITE_beam_files",
+ testonly = True,
+ srcs = ["test/config_schema_SUITE.erl"],
+ outs = ["test/config_schema_SUITE.beam"],
+ erlc_opts = "//:test_erlc_opts",
+ )
+ erlang_bytecode(
+ name = "integration_SUITE_beam_files",
+ testonly = True,
+ srcs = ["test/integration_SUITE.erl"],
+ outs = ["test/integration_SUITE.beam"],
+ erlc_opts = "//:test_erlc_opts",
+ deps = ["//deps/rabbitmq_ct_helpers:erlang_app"],
+ )
+ erlang_bytecode(
+ name = "test_aws_ecs_util_beam",
+ testonly = True,
+ srcs = ["test/aws_ecs_util.erl"],
+ outs = ["test/aws_ecs_util.beam"],
+ erlc_opts = "//:test_erlc_opts",
+ deps = ["//deps/rabbitmq_ct_helpers:erlang_app"],
+ )
+ erlang_bytecode(
+ name = "unit_SUITE_beam_files",
+ testonly = True,
+ srcs = ["test/unit_SUITE.erl"],
+ outs = ["test/unit_SUITE.beam"],
+ erlc_opts = "//:test_erlc_opts",
+ )