Build with v2.14.2, bazel build
Remove buck files.
Fix warnings.
Change-Id: Iac1b6fec18fa79c9b0074555b312ac543e6bf2be
diff --git a/BUCK b/BUCK
deleted file mode 100644
index 80e5325..0000000
--- a/BUCK
+++ /dev/null
@@ -1,17 +0,0 @@
-include_defs('//bucklets/gerrit_plugin.bucklet')
-
-gerrit_plugin(
- name = 'login-redirect',
- srcs = glob(['src/main/java/**/*.java']),
- resources = glob(['src/main/resources/**/*']),
- manifest_entries = [
- 'Gerrit-PluginName: login-redirect',
- 'Gerrit-HttpModule: com.googlesource.gerrit.plugins.loginredirect.LoginRedirectModule',
- 'Implementation-Title: Login Redirect plug-in',
- ]
-)
-
-java_library(
- name = 'classpath',
- deps = GERRIT_PLUGIN_API + [':login-redirect__plugin'],
-)
diff --git a/BUILD b/BUILD
new file mode 100644
index 0000000..0ec0321
--- /dev/null
+++ b/BUILD
@@ -0,0 +1,12 @@
+load("//tools/bzl:plugin.bzl", "gerrit_plugin")
+
+gerrit_plugin(
+ name = "login-redirect",
+ srcs = glob(["src/main/java/**/*.java"]),
+ manifest_entries = [
+ "Gerrit-PluginName: login-redirect",
+ "Gerrit-HttpModule: com.googlesource.gerrit.plugins.loginredirect.LoginRedirectModule",
+ "Implementation-Title: Login Redirect plug-in",
+ ],
+ resources = glob(["src/main/resources/**/*"]),
+)
diff --git a/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java b/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java
index 4042cde..204bdbc 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java
@@ -20,9 +20,6 @@
import com.google.inject.Inject;
import com.google.inject.Singleton;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import java.io.IOException;
import javax.servlet.FilterChain;
@@ -34,9 +31,6 @@
@Singleton
public class LoginRedirectFilter extends AllRequestFilter {
- private static final Logger log =
- LoggerFactory.getLogger(LoginRedirectFilter.class);
-
@Inject
private DynamicItem<WebSession> sessionProvider;
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
index 1086a18..f893189 100644
--- a/src/main/resources/Documentation/build.md
+++ b/src/main/resources/Documentation/build.md
@@ -1,63 +1,14 @@
Build
=====
-This @PLUGIN@ plugin is built with Buck.
+This @PLUGIN@ plugin is built with Bazel.
-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.
+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 @PLUGIN@ plugin directory:
-
-```
- cd @PLUGIN@ && ln -s ../bucklets .
-```
-
-Add link to the .buckversion file:
-
-```
- cd @PLUGIN@ && ln -s bucklets/buckversion .buckversion
-```
-
-Add link to the .watchmanconfig file:
-
-```
- cd @PLUGIN@ && ln -s bucklets/watchmanconfig .watchmanconfig
-```
-
-To build the plugin, issue the following command:
-
-```
- buck build plugin
-```
-
-The output is created in
-
-```
- buck-out/gen/@PLUGIN@.jar
-```
-
-This project can be imported into the Eclipse IDE:
-
-```
- ./bucklets/tools/eclipse.py
-```
-
-#### 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/@PLUGIN@
+ bazel build plugins/@PLUGIN@
```
in the root of Gerrit's source tree to build
@@ -65,15 +16,22 @@
The output is created in
```
- buck-out/gen/plugins/@PLUGIN@/@PLUGIN@.jar
+ bazel-genfiles/plugins/@PLUGIN@/@PLUGIN@.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
```
-[Back to @PLUGIN@ documentation index][index]
+To execute the tests run:
-[index]: index.html
+```
+ bazel test plugins/@PLUGIN@:websession_flatfile_tests
+```
+
+How to build the Gerrit Plugin API is described in the [Gerrit
+documentation](../../../Documentation/dev-bazel.html#_extension_and_plugin_api_jar_files).