Skip to content

Commit

Permalink
Update Khepri, add Horus dependency
Browse files Browse the repository at this point in the history
This commit updates Khepri to the 0.7.0 tag commit and adds Horus as
a dependency using the following commands to regenerate the bazel build
files:

    bazel run gazelle -- update-repos \
      --verbose \
      --build_files_dir=bazel \
      github.com/rabbitmq/horus@d9061b945a3a3261f639fbd7e7fcd0624fa2e9ad
    bazel run gazelle -- update-repos \
      --verbose \
      --build_files_dir=bazel \
      github.com/rabbitmq/khepri@e5b8753ef14212baaa53af8171ad71b3848003d4

Plus some manual tuning for the Khepri build file.
  • Loading branch information
the-mikedavis committed May 1, 2023
1 parent ef1f77c commit aa88611
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 298 deletions.
10 changes: 9 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ erlang_package.hex_package(
version = "1.3.3",
)

erlang_package.git_package(
name = "horus",
build_file = "@rabbitmq-server//bazel:BUILD.horus",
commit = "d9061b945a3a3261f639fbd7e7fcd0624fa2e9ad",
repository = "rabbitmq/horus",
)

erlang_package.git_package(
name = "jose",
build_file = "@rabbitmq-server//bazel:BUILD.jose",
Expand All @@ -242,7 +249,7 @@ erlang_package.hex_package(
erlang_package.git_package(
name = "khepri",
build_file = "@rabbitmq-server//bazel:BUILD.khepri",
commit = "295bf1e91a20e5260ee3df9fdb8423b16c1d518a",
commit = "e5b8753ef14212baaa53af8171ad71b3848003d4",
repository = "rabbitmq/khepri",
)

Expand Down Expand Up @@ -368,6 +375,7 @@ use_repo(
"gen_batch_server",
"getopt",
"gun",
"horus",
"jose",
"json",
"khepri",
Expand Down
114 changes: 114 additions & 0 deletions bazel/BUILD.horus
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
load("@rules_erlang//:erlang_bytecode2.bzl", "erlang_bytecode", "erlc_opts")
load("@rules_erlang//:erlang_app.bzl", "erlang_app")

erlc_opts(
name = "erlc_opts",
values = select({
"@rules_erlang//:debug_build": [
"+debug_info",
"+warn_export_vars",
"+warnings_as_errors",
],
"//conditions:default": [
"+debug_info",
"+deterministic",
"+warn_export_vars",
"+warnings_as_errors",
],
}),
visibility = [":__subpackages__"],
)

erlang_bytecode(
name = "other_beam",
srcs = [
"src/horus.erl",
"src/horus_cover.erl",
"src/horus_utils.erl",
],
hdrs = [":public_and_private_hdrs"],
app_name = "horus",
dest = "ebin",
erlc_opts = "//:erlc_opts",
)

filegroup(
name = "beam_files",
srcs = [":other_beam"],
)

filegroup(
name = "srcs",
srcs = [
"src/horus.app.src",
"src/horus.erl",
"src/horus_cover.erl",
"src/horus_utils.erl",
],
)

filegroup(
name = "private_hdrs",
srcs = [
"src/horus_error.hrl",
"src/horus_fun.hrl",
],
)

filegroup(
name = "public_hdrs",
srcs = [
"include/horus.hrl",
],
)

filegroup(
name = "priv",
srcs = [
"priv/horus_cover_helper.erl",
],
)

filegroup(
name = "license_files",
srcs = [
"LICENSE-Apache-2.0",
"LICENSE-MPL-2.0",
],
)

filegroup(
name = "public_and_private_hdrs",
srcs = [
":private_hdrs",
":public_hdrs",
],
)

filegroup(
name = "all_srcs",
srcs = [
":public_and_private_hdrs",
":srcs",
],
)

erlang_app(
name = "erlang_app",
srcs = [":all_srcs"],
hdrs = [":public_hdrs"],
app_name = "horus",
beam_files = [":beam_files"],
extra_apps = [
"compiler",
"tools",
],
license_files = [":license_files"],
priv = [":priv"],
)

alias(
name = "horus",
actual = ":erlang_app",
visibility = ["//visibility:public"],
)
Loading

0 comments on commit aa88611

Please sign in to comment.