diff --git a/.gitignore b/.gitignore index 0727dffc..509a2744 100755 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ *.*~ build/ -install/ \ No newline at end of file +install/ + +bazel-* +MODULE.bazel.lock diff --git a/BUILD.bazel b/BUILD.bazel index 5e4db202..e46a9758 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,12 +1,13 @@ cc_library( name = "modern-cpp-kafka-api", - - hdrs = glob(["include/kafka/*.h", "include/kafka/addons/*.h"]), - + hdrs = glob([ + "include/kafka/*.h", + "include/kafka/addons/*.h", + ]), includes = ["include"], - linkopts = ["-lpthread"], - visibility = ["//visibility:public"], + deps = [ + "@rapidjson", + ], ) - diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 00000000..b34e689a --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,5 @@ +module(name = "modern-cpp-kafka") + +bazel_dep(name = "boost.algorithm", version = "1.87.0") +bazel_dep(name = "googletest", version = "1.16.0", repo_name = "gtest") +bazel_dep(name = "rapidjson", version = "1.1.0.bcr.20241007") diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 5e1ccfaf..c3a94e31 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -1,52 +1,50 @@ cc_test( name = "kafka-unit-test", - - srcs = glob(["unit/*.cc", "utils/*.h"]), - - deps = ["//:modern-cpp-kafka-api", - "@gtest//:gtest", - "@gtest//:gtest_main", - "@rapidjson//:rapidjson"], - - linkopts = ["-lrdkafka"], - timeout = "short", - + srcs = glob([ + "unit/*.cc", + "utils/*.h", + ]), + linkopts = ["-lrdkafka"], tags = ["unit"], + deps = [ + "//:modern-cpp-kafka-api", + "@boost.algorithm", + "@gtest", + "@gtest//:gtest_main", + ], ) - cc_test( name = "kafka-integration-test", - - srcs = glob(["integration/*.cc", "utils/*.h"]), - - deps = ["//:modern-cpp-kafka-api", - "@gtest//:gtest", - "@gtest//:gtest_main"], - - linkopts = ["-lrdkafka"], - timeout = "long", + srcs = glob([ + "integration/*.cc", + "utils/*.h", + ]), + linkopts = ["-lrdkafka"], shard_count = 8, - tags = ["integration"], + deps = [ + "//:modern-cpp-kafka-api", + "@gtest", + "@gtest//:gtest_main", + ], ) cc_test( name = "kafka-robustness-test", - - srcs = glob(["robustness/*.cc", "utils/*.h"]), - - deps = ["//:modern-cpp-kafka-api", - "@gtest//:gtest", - "@gtest//:gtest_main"], - - linkopts = ["-lrdkafka"], - timeout = "long", + srcs = glob([ + "robustness/*.cc", + "utils/*.h", + ]), + linkopts = ["-lrdkafka"], shard_count = 1, - tags = ["robustness"], + deps = [ + "//:modern-cpp-kafka-api", + "@gtest", + "@gtest//:gtest_main", + ], ) -