Add support for Bazel in Gerrit tree build
Change-Id: If517d688bdc0ce3644bfe7e7de50bbf272f48602
diff --git a/BUILD b/BUILD
new file mode 100644
index 0000000..bc803a6
--- /dev/null
+++ b/BUILD
@@ -0,0 +1,17 @@
+load("//tools/bzl:plugin.bzl", "gerrit_plugin")
+
+gerrit_plugin(
+ name = "serviceuser",
+ srcs = glob(["src/main/java/**/*.java"]),
+ resources = glob(["src/main/**/*"]),
+ gwt_module = "com.googlesource.gerrit.plugins.serviceuser.CreateServiceUserForm",
+ manifest_entries = [
+ "Gerrit-PluginName: serviceuser",
+ "Gerrit-Module: com.googlesource.gerrit.plugins.serviceuser.Module",
+ "Gerrit-HttpModule: com.googlesource.gerrit.plugins.serviceuser.HttpModule",
+ "Gerrit-SshModule: com.googlesource.gerrit.plugins.serviceuser.SshModule",
+ ],
+ provided_deps = [
+ "@commons_codec//jar:neverlink",
+ ],
+)
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
index ab86b9c..ff88faf 100644
--- a/src/main/resources/Documentation/build.md
+++ b/src/main/resources/Documentation/build.md
@@ -1,63 +1,27 @@
Build
=====
-This plugin is built with Buck.
+This plugin is built with Bazel.
-Two build modes are supported: Standalone and in Gerrit tree. Standalone
-build mode is recommended, as this mode doesn't require local Gerrit
-tree to exist.
+Clone (or link) this plugin to the `plugins` directory of Gerrit's source tree.
-Build standalone
-----------------
-
-Clone bucklets library:
+Then issue
```
- git clone https://gerrit.googlesource.com/bucklets
-
-```
-and link it to serviceuser directory:
-
-```
- cd serviceuser && ln -s ../bucklets .
+ bazel build plugins/@PLUGIN@
```
-Add link to the .buckversion file:
-
-```
- cd serviceuser && ln -s bucklets/buckversion .buckversion
-```
-
-To build the plugin, issue the following command:
-
-
-```
- buck build plugin
-```
+in the root of Gerrit's source tree to build
The output is created in
```
- buck-out/gen/serviceuser/serviceuser.jar
+ bazel-genfiles/plugins/@PLUGIN@/@PLUGIN@.jar
```
-Build in Gerrit tree
---------------------
-
-Clone or link this plugin to the plugins directory of Gerrit's source
-tree, and issue the command:
-
-```
- buck build plugins/serviceuser
-```
-
-The output is created in
-
-```
- buck-out/gen/plugins/serviceuser/serviceuser.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