If you want to understand more of how this technically works read this blog post.
This repo contains standalone Bazel BUILD configuration for part of the Apache Kafka project that could be shared by dependent projects using the Bazel build system.
This project is heavily inspired from llvm-bazel to bring Bazel build system to Apache Kafka.
Start off by git clone --recurse-submodules https://github.com/confluentinc/kafka-bazel
This includes by default a git-submodule of Apache Kafka (third_party/kafka) that will track the latest on trunk; it can be changed to point to your local repository.
Build ⚒️. Profit. 💰
> bazel build @kafka//...
INFO: Invocation ID: b97ba747-5d25-449b-bc20-757c5a89bbc9
INFO: Analyzed 4333 targets (102 packages loaded, 12244 targets configured).
INFO: Found 4333 targets...
INFO: Elapsed time: 16.142s, Critical Path: 13.12s
INFO: 2 processes: 1 internal, 1 worker.
INFO: Build completed successfully, 2 total actions
☝️ All the build targets will start with @kafka//
.
- All build targets are buildable
@kafka//...
but not all test targets are passing as of yet. - A minor patch file must be applied to the Apache Kafka repository.