Add support for Bazel in Gerrit tree build

Change-Id: Ie663a79c09dec9856675858eae57c642bf4e2f35
diff --git a/BUILD b/BUILD
new file mode 100644
index 0000000..be554f4
--- /dev/null
+++ b/BUILD
@@ -0,0 +1,10 @@
+load("//tools/bzl:plugin.bzl", "gerrit_plugin")
+
+gerrit_plugin(
+    name = "metrics-reporter-jmx",
+    srcs = glob(["src/main/java/**/*.java"]),
+    resources = glob(["src/main/resources/**/*"]),
+    manifest_entries = [
+        "Gerrit-PluginName: metrics-reporter-jmx",
+    ],
+)
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
new file mode 100644
index 0000000..5262434
--- /dev/null
+++ b/src/main/resources/Documentation/build.md
@@ -0,0 +1,32 @@
+Build
+=====
+
+This plugin is built with Bazel.
+
+Clone (or link) this plugin to the `plugins` directory of Gerrit's source tree.
+
+Then issue
+
+```
+  bazel build plugins/@PLUGIN@
+```
+
+in the root of Gerrit's source tree to build
+
+The output is created in
+
+```
+  bazel-genfiles/plugins/@PLUGIN@/@PLUGIN@.jar
+```
+
+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
+```
+
+[Back to @PLUGIN@ documentation index][index]
+
+[index]: index.html