From 5920be5caa47ce697b57275bb493e91352b2f523 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Wed, 13 Mar 2024 00:51:41 +0100 Subject: [PATCH] chore(bazel): add MODULE.bazel files for bzlmod Signed-off-by: Matthieu MOREL --- .bazelrc | 2 ++ .bazelversion | 2 +- .gitignore | 2 ++ MODULE.bazel | 39 +++++++++++++++++++++++++++++++++++++++ WORKSPACE.bzlmod | 0 common/BUILD | 2 +- demo/BUILD | 9 --------- demo/MODULE.bazel | 20 ++++++++++++++++++++ demo/WORKSPACE.bzlmod | 0 example/BUILD | 2 +- 10 files changed, 66 insertions(+), 12 deletions(-) create mode 100644 MODULE.bazel create mode 100644 WORKSPACE.bzlmod create mode 100644 demo/MODULE.bazel create mode 100644 demo/WORKSPACE.bzlmod diff --git a/.bazelrc b/.bazelrc index 63bcd97..36452ea 100644 --- a/.bazelrc +++ b/.bazelrc @@ -106,3 +106,5 @@ build:coverage --strategy=CoverageReport=local build:coverage --experimental_use_llvm_covmap build:coverage --collect_code_coverage build:coverage --test_tag_filters=-nocoverage + +common --enable_bzlmod diff --git a/.bazelversion b/.bazelversion index 0c89fc9..f4965a3 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -4.0.0 \ No newline at end of file +6.0.0 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4f6c836..31d4872 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ coverage_report/ /compile_commands.json # Ignore the directory in which `clangd` stores its local index. /.cache/ + +MODULE.bazel.lock diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..afe5e6f --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,39 @@ +module( + name = "hessian2-codec", + repo_name = "com_alibaba_hessian2_codec", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.4.1", +) +bazel_dep( + name = "abseil-cpp", + version = "20220623.1", + repo_name = "com_google_absl", +) +bazel_dep( + name = "fmt", + version = "8.1.1", + repo_name = "com_github_fmtlib_fmt", +) +bazel_dep( + name = "googletest", + version = "1.11.0", + repo_name = "com_google_googletest", +) +bazel_dep( + name = "hedron_compile_commands", + version = "", +) +bazel_dep( + name = "platforms", + version = "0.0.8", +) +# -- bazel_dep definitions -- # + +git_override( + module_name = "hedron_compile_commands", + commit = "5bcb0bd8a917b2b48fb5dc55818515f4be3b63ff", + remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git", +) diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod new file mode 100644 index 0000000..e69de29 diff --git a/common/BUILD b/common/BUILD index 095a7ca..2f3b06e 100644 --- a/common/BUILD +++ b/common/BUILD @@ -33,7 +33,7 @@ cc_library( ], copts = DEFAULT_COPTS, deps = [ - "@com_github_fmtlib_fmt//:fmtlib", + "@com_github_fmtlib_fmt//:fmt", "@com_google_absl//absl/strings", ], ) diff --git a/demo/BUILD b/demo/BUILD index 899d3fa..3abbd57 100644 --- a/demo/BUILD +++ b/demo/BUILD @@ -1,15 +1,6 @@ load( "@com_google_absl//absl:copts/GENERATED_copts.bzl", - "ABSL_GCC_EXCEPTIONS_FLAGS", "ABSL_GCC_FLAGS", - "ABSL_GCC_TEST_FLAGS", - "ABSL_LLVM_EXCEPTIONS_FLAGS", - "ABSL_LLVM_FLAGS", - "ABSL_LLVM_TEST_FLAGS", - "ABSL_MSVC_EXCEPTIONS_FLAGS", - "ABSL_MSVC_FLAGS", - "ABSL_MSVC_LINKOPTS", - "ABSL_MSVC_TEST_FLAGS", ) package(default_visibility = ["//visibility:public"]) diff --git a/demo/MODULE.bazel b/demo/MODULE.bazel new file mode 100644 index 0000000..9ea3001 --- /dev/null +++ b/demo/MODULE.bazel @@ -0,0 +1,20 @@ +module( + name = "com_alibaba_hessian2_codec_demo", +) + +bazel_dep( + name = "hessian2-codec", + version = "", + repo_name = "com_alibaba_hessian2_codec", +) +bazel_dep( + name = "abseil-cpp", + version = "20220623.1", + repo_name = "com_google_absl", +) +# -- bazel_dep definitions -- # + +local_path_override( + module_name = "hessian2-codec", + path = "..", +) diff --git a/demo/WORKSPACE.bzlmod b/demo/WORKSPACE.bzlmod new file mode 100644 index 0000000..e69de29 diff --git a/example/BUILD b/example/BUILD index 0dbd652..a9f7bdd 100644 --- a/example/BUILD +++ b/example/BUILD @@ -1,4 +1,4 @@ -load("//:copts.bzl", "DEFAULT_COPTS", "TEST_COPTS") +load("//:copts.bzl", "DEFAULT_COPTS") package(default_visibility = ["//visibility:public"])