Add support for Bazel in Gerrit tree build

Change-Id: Icad8def01e08710fb32fbf77c1993455b86d29dd
diff --git a/BUILD b/BUILD
new file mode 100644
index 0000000..1756206
--- /dev/null
+++ b/BUILD
@@ -0,0 +1,16 @@
+load("//tools/bzl:plugin.bzl", "gerrit_plugin")
+
+gerrit_plugin(
+    name = "kafka-events",
+    srcs = glob(["src/main/java/**/*.java"]),
+    resources = glob(["src/main/resources/**/*"]),
+    manifest_entries = [
+        "Gerrit-PluginName: kafka-events",
+        "Gerrit-Module: com.googlesource.gerrit.plugins.kafka.Module",
+        "Implementation-Title: Gerrit Apache Kafka plugin",
+        "Implementation-URL: https://gerrit.googlesource.com/plugins/kafka-events",
+    ],
+    deps = [
+        "@kafka_client//jar",
+    ],
+)
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
new file mode 100644
index 0000000..556e903
--- /dev/null
+++ b/external_plugin_deps.bzl
@@ -0,0 +1,8 @@
+load("//tools/bzl:maven_jar.bzl", "maven_jar")
+
+def external_plugin_deps():
+  maven_jar(
+    name = 'kafka_client',
+    artifact = 'org.apache.kafka:kafka-clients:0.10.0.1',
+    sha1 = '36ebf4044d0e546bf74c95629d736ca63320a323',
+  )
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
index 0e292bd..77e8771 100644
--- a/src/main/resources/Documentation/build.md
+++ b/src/main/resources/Documentation/build.md
@@ -1,7 +1,7 @@
 Build
 =====
 
-This plugin is built with Buck.
+This plugin is built with Bazel.
 
 Build in Gerrit tree
 --------------------
@@ -10,20 +10,22 @@
 tree, and issue the command:
 
 ```
-  buck build plugins/kafka-events
+  bazel build plugins/kafka-events
 ```
 
 The output is created in
 
 ```
-  buck-out/gen/plugins/kafka-events/kafka-events.jar
+  bazel-genfiles/plugins/kafka-events/kafka-events.jar
 ```
 
-This project can be imported into the Eclipse IDE:
+This project can be imported into the Eclipse IDE.
+Add the plugin name to the `CUSTOM_PLUGINS` set in
+Gerrit core in `tools/bzl/plugins.bzl`, and execute:
 
 ```
   ./tools/eclipse/project.py
 ```
 
 How to build the Gerrit Plugin API is described in the [Gerrit
-documentation](../../../Documentation/dev-buck.html#_extension_and_plugin_api_jar_files).
+documentation](../../../Documentation/dev-bazel.html#_extension_and_plugin_api_jar_files).