diff options
author | Philip Kuryloski <kuryloskip@vmware.com> | 2021-03-29 11:01:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 11:01:43 +0200 |
commit | 388654c5422409ccb7f26bf9e267d9aff4a52ba0 (patch) | |
tree | aff7b9db6cc3120fd851fd5a87b220b59717c3d2 /deps/amqp10_common | |
parent | e98b343095c163da7732eda1aaad9a9f20054664 (diff) | |
download | rabbitmq-server-git-388654c5422409ccb7f26bf9e267d9aff4a52ba0.tar.gz |
Add a partial Bazel build (#2938)
Adds WORKSPACE.bazel, BUILD.bazel & *.bzl files for partial build & test with Bazel. Introduces a build-time dependency on https://github.com/rabbitmq/bazel-erlang
Diffstat (limited to 'deps/amqp10_common')
-rw-r--r-- | deps/amqp10_common/BUILD.bazel | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/deps/amqp10_common/BUILD.bazel b/deps/amqp10_common/BUILD.bazel new file mode 100644 index 0000000000..c2a222e863 --- /dev/null +++ b/deps/amqp10_common/BUILD.bazel @@ -0,0 +1,74 @@ +load("@bazel-erlang//:bazel_erlang_lib.bzl", "app_file", "bazel_erlang_lib", "erlc") +load("@bazel-erlang//:ct.bzl", "ct_suite") +load("//:rabbitmq.bzl", "APP_VERSION") + +py_binary( + name = "codegen", + srcs = [ + "codegen.py", + ], + imports = ["../../deps/rabbitmq_codegen"], + deps = [ + "//deps/rabbitmq_codegen:amqp_codegen", + ], +) + +AMQP_SPEC_1_0 = [ + "//deps/rabbitmq_codegen:amqp-1.0/messaging.xml", + "//deps/rabbitmq_codegen:amqp-1.0/security.xml", + "//deps/rabbitmq_codegen:amqp-1.0/transport.xml", + "//deps/rabbitmq_codegen:amqp-1.0/transactions.xml", +] + +genrule( + name = "generated_headers", + srcs = AMQP_SPEC_1_0, + outs = ["include/amqp10_framing.hrl"], + cmd = "$(location :codegen) hrl $(SRCS) > $@", + tools = [":codegen"], +) + +genrule( + name = "generated_sources", + srcs = AMQP_SPEC_1_0, + outs = ["src/amqp10_framing0.erl"], + cmd = "$(location :codegen) erl $(SRCS) > $@", + tools = [":codegen"], +) + +app_file( + name = "app_file", + app_description = "Modules shared by rabbitmq-amqp1.0 and rabbitmq-amqp1.0-client", + app_name = "amqp10_common", + app_version = APP_VERSION, + modules = [":beam_files"], +) + +erlc( + name = "beam_files", + srcs = ["src/amqp10_framing0.erl"] + glob(["src/*.erl"]), + hdrs = ["include/amqp10_framing.hrl"] + glob(["include/*.hrl"]), + dest = "ebin", +) + +bazel_erlang_lib( + name = "bazel_erlang_lib", + hdrs = ["include/amqp10_framing.hrl"] + glob(["include/*.hrl"]), + app = ":app_file", + app_name = "amqp10_common", + beam = [":beam_files"], + visibility = ["//visibility:public"], +) + +bazel_erlang_lib( + name = "test_bazel_erlang_lib", + hdrs = ["include/amqp10_framing.hrl"] + glob(["include/*.hrl"]), + app = ":app_file", + app_name = "amqp10_common", + beam = [":beam_files"], + visibility = ["//visibility:public"], +) + +ct_suite( + suite_name = "binary_generator_SUITE", +) |