Update bazlets and switch to using external_plugin_deps.bzl
Also switch to using external_plugin_deps.bzl file in gerrit tree build.
Change-Id: I4da01065e876dece3e67cd95fb0436327c760ffe
diff --git a/WORKSPACE b/WORKSPACE
index 4aacb00..19ff724 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,8 +3,8 @@
load("//:bazlets.bzl", "load_bazlets")
load_bazlets(
- commit = "3bec81727c69207e591ae1761d5a78d8ec418a0b",
-# local_path = "/home/davido/projects/bazlets",
+ commit = "0f87babe07a555425d829c6e7951e296e9e24579",
+ # local_path = "/home/<user>/projects/bazlets",
)
# Release Plugin API
diff --git a/WORKSPACE.in_gerrit_tree b/WORKSPACE.in_gerrit_tree
deleted file mode 100644
index e6f30b9..0000000
--- a/WORKSPACE.in_gerrit_tree
+++ /dev/null
@@ -1,7 +0,0 @@
-
-maven_jar(
- name = "scribe",
- artifact = "org.scribe:scribe:1.3.7",
- sha1 = "583921bed46635d9f529ef5f14f7c9e83367bc6e",
-)
-
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
new file mode 100644
index 0000000..d04c600
--- /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 = "scribe",
+ artifact = "org.scribe:scribe:1.3.7",
+ sha1 = "583921bed46635d9f529ef5f14f7c9e83367bc6e",
+ )
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
index f9239c1..7237c9c 100644
--- a/src/main/resources/Documentation/build.md
+++ b/src/main/resources/Documentation/build.md
@@ -1,11 +1,25 @@
Build
=====
-This plugin is built with Bazel.
+This plugin is built with Bazel. To install Bazel, follow
+the instruction on: https://www.bazel.io/versions/master/docs/install.html.
+
+Two build modes are supported: Standalone and in Gerrit tree.
+The standalone build mode is recommended, as this mode doesn't
+require the Gerrit tree to exist locally.
+
+### Build standalone
+
+Clone the plugin:
```
git clone https://gerrit.googlesource.com/plugins/oauth
cd oauth
+```
+
+Issue the command:
+
+```
bazel build :all
```
@@ -20,3 +34,44 @@
```
./tools/eclipse/project.py
```
+
+### Build in Gerrit tree
+
+Clone or link this plugin to the plugins directory of Gerrit's
+source tree, and issue the command:
+
+```
+ git clone https://gerrit.googlesource.com/gerrit
+ git clone https://gerrit.googlesource.com/plugins/@PLUGIN@
+ cd gerrit/plugins
+ ln -s ../../@PLUGIN@ .
+```
+
+Put the external dependency Bazel build file into the Gerrit /plugins
+directory, replacing the existing empty one.
+
+```
+ cd gerrit/plugins
+ rm external_plugin_deps.bzl
+ ln -s @PLUGIN@/external_plugin_deps.bzl .
+```
+
+From Gerrit source tree issue the command:
+
+```
+ bazel build plugins/@PLUGIN@
+```
+
+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
+```