Update the checks plugin to use the new gerrit_js_bundle Bazel rule

Change-Id: I4ad5fa53fab4f7da5b4679f51360c4d2ad44a4df
diff --git a/BUILD b/BUILD
index e1a244a..bce3131 100644
--- a/BUILD
+++ b/BUILD
@@ -19,7 +19,7 @@
         "Gerrit-HttpModule: com.google.gerrit.plugins.checks.HttpModule",
         "Gerrit-InitStep: com.google.gerrit.plugins.checks.Init",
     ],
-    resource_jars = ["//plugins/checks/gr-checks:gr-checks-static"],
+    resource_jars = ["//plugins/checks/gr-checks:checks"],
     resource_strip_prefix = "plugins/checks/resources",
     resources = glob(["resources/**/*"]),
     deps = ["//plugins/checks/proto:cache_java_proto"],
diff --git a/gr-checks/BUILD b/gr-checks/BUILD
index 034acd2..8eee11e 100644
--- a/gr-checks/BUILD
+++ b/gr-checks/BUILD
@@ -1,6 +1,4 @@
-load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
-load("//tools/bzl:js.bzl", "polygerrit_plugin")
-load("//tools/bzl:genrule2.bzl", "genrule2")
+load("//tools/bzl:js.bzl", "gerrit_js_bundle")
 
 package_group(
     name = "visibility",
@@ -9,32 +7,8 @@
 
 package(default_visibility = [":visibility"])
 
-polygerrit_plugin(
-    name = "gr-checks",
-    app = "checks-bundle.js",
-    plugin_name = "checks",
-)
-
-rollup_bundle(
-    name = "checks-bundle",
+gerrit_js_bundle(
+    name = "checks",
     srcs = glob(["*.js"]),
     entry_point = "gr-checks.js",
-    format = "iife",
-    rollup_bin = "//tools/node_tools:rollup-bin",
-    sourcemap = "hidden",
-    deps = [
-        "@tools_npm//rollup-plugin-node-resolve",
-    ],
-)
-
-genrule2(
-    name = "gr-checks-static",
-    srcs = [":gr-checks"],
-    outs = ["gr-checks-static.jar"],
-    cmd = " && ".join([
-        "mkdir $$TMP/static",
-        "cp -r $(locations :gr-checks) $$TMP/static",
-        "cd $$TMP",
-        "zip -Drq $$ROOT/$@ -g .",
-    ]),
 )