Support eclipse integration in bazel standalone mode

Also upgrade bazlet to latest version to get the project.py fix that
allows project.py to be used for plugins.

Change-Id: I95f79bdd6495985e61f956d40648e4f2d9789239
diff --git a/.gitignore b/.gitignore
index 05423f6..c8f9211 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,6 @@
 /.settings
 /local.properties
 *.pyc
+/.primary_build_tool
 /bazel-*
+/eclipse-out
diff --git a/WORKSPACE b/WORKSPACE
index d90ff5d..c1b661f 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
 load("//:bazlets.bzl", "load_bazlets")
 
 load_bazlets(
-    commit = "28aa2290c7f7742261d69b358f3de30d2e87c13b",
+    commit = "e50890188cd63f79d4a8529f90024f56168f9c9a",
     #    local_path = "/home/<user>/projects/bazlets",
 )
 
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
index 770d643..491e134 100644
--- a/src/main/resources/Documentation/build.md
+++ b/src/main/resources/Documentation/build.md
@@ -19,6 +19,12 @@
   bazel-genfiles/@PLUGIN@.jar
 ```
 
+This project can be imported into the Eclipse IDE:
+
+```
+  ./tools/eclipse/project.sh
+```
+
 ### Build in Gerrit tree
 
 ```
diff --git a/tools/bzl/classpath.bzl b/tools/bzl/classpath.bzl
new file mode 100644
index 0000000..dfcbe9c
--- /dev/null
+++ b/tools/bzl/classpath.bzl
@@ -0,0 +1,2 @@
+load("@com_googlesource_gerrit_bazlets//tools:classpath.bzl",
+     "classpath_collector")
diff --git a/tools/bzl/plugin.bzl b/tools/bzl/plugin.bzl
index 2b1df8c..74d4ce1 100644
--- a/tools/bzl/plugin.bzl
+++ b/tools/bzl/plugin.bzl
@@ -1,4 +1,6 @@
 load(
     "@com_googlesource_gerrit_bazlets//:gerrit_plugin.bzl",
     "gerrit_plugin",
+    "PLUGIN_DEPS",
+    "GWT_PLUGIN_DEPS",
 )
diff --git a/tools/eclipse/BUILD b/tools/eclipse/BUILD
new file mode 100644
index 0000000..84e079c
--- /dev/null
+++ b/tools/eclipse/BUILD
@@ -0,0 +1,20 @@
+load(
+    "//tools/bzl:plugin.bzl",
+    "PLUGIN_DEPS",
+    "GWT_PLUGIN_DEPS",
+)
+load("//tools/bzl:classpath.bzl", "classpath_collector")
+
+CP_DEPS = PLUGIN_DEPS + GWT_PLUGIN_DEPS + [
+    "//:reviewers__plugin",
+]
+
+java_library(
+    name = "classpath",
+    runtime_deps = CP_DEPS,
+)
+
+classpath_collector(
+    name = "main_classpath_collect",
+    deps = CP_DEPS,
+)
diff --git a/tools/eclipse/project.sh b/tools/eclipse/project.sh
new file mode 100755
index 0000000..43ae7cc
--- /dev/null
+++ b/tools/eclipse/project.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+`bazel query @com_googlesource_gerrit_bazlets//tools/eclipse:project --output location | sed s/BUILD:.*//`project.py -n reviewers -r .