Revert "Add Polymer 3 support"
This reverts commit bd28cc1eaeb01b2118e85e76e00ef4f39a6c9958 because it
breaks existing users of js.bzl by requiring them to setup a npm repo.
If we want to add this in 3.2 (which I'm not sure we need), we should do
it in a new file so that it doesn't affect existing users.
Change-Id: Ic11ec7cd05d885f9df89ed98e9f65a6339eaa863
diff --git a/gerrit_polymer.bzl b/gerrit_polymer.bzl
index 735d22f..2d019d2 100644
--- a/gerrit_polymer.bzl
+++ b/gerrit_polymer.bzl
@@ -16,9 +16,3 @@
sha256 = "5a589bdba674e1fec7188e9251c8624ebf2d4d969beb6635f9148f420d1e08b1",
urls = ["https://raw.githubusercontent.com/google/closure-compiler/775609aad61e14aef289ebec4bfc09ad88877f9e/contrib/externs/polymer-1.0.js"],
)
-
- http_archive(
- name = "build_bazel_rules_nodejs",
- sha256 = "1134ec9b7baee008f1d54f0483049a97e53a57cd3913ec9d6db625549c98395a",
- urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.4.0/rules_nodejs-3.4.0.tar.gz"],
- )
diff --git a/tools/js.bzl b/tools/js.bzl
index 7bd33da..21cfa73 100644
--- a/tools/js.bzl
+++ b/tools/js.bzl
@@ -1,10 +1,6 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary", "closure_js_library")
load("//lib/js:npm.bzl", "NPM_SHA1S", "NPM_VERSIONS")
-load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
-load("@npm//@bazel/terser:index.bzl", "terser_minified")
-load("@com_googlesource_gerrit_bazlets//tools:genrule2.bzl", "genrule2")
-
NPMJS = "NPMJS"
GERRIT = "GERRIT:"
@@ -523,56 +519,3 @@
name = name,
srcs = static_files,
)
-
-def gerrit_js_bundle(name, srcs, entry_point):
- """Produces a Gerrit JavaScript bundle archive.
-
- This rule bundles and minifies the javascript files of a frontend plugin and
- produces a file archive.
- Output of this rule is an archive with "${name}.jar" with specific layout for
- Gerrit frontend plugins. That archive should be provided to gerrit_plugin
- rule as resource_jars attribute.
-
- Args:
- name: Plugin name.
- srcs: Plugin sources.
- entry_point: Plugin entry_point.
- """
-
- bundle = name + "-bundle"
- minified = name + ".min"
- main = name + ".js"
-
- rollup_bundle(
- name = bundle,
- srcs = srcs,
- entry_point = entry_point,
- format = "iife",
- sourcemap = "hidden",
- )
-
- terser_minified(
- name = minified,
- sourcemap = False,
- src = bundle,
- )
-
- native.genrule(
- name = name + "_rename_js",
- srcs = [minified],
- outs = [main],
- cmd = "cp $< $@",
- output_to_bindir = True,
- )
-
- genrule2(
- name = name,
- srcs = [main],
- outs = [name + ".jar"],
- cmd = " && ".join([
- "mkdir $$TMP/static",
- "cp $(SRCS) $$TMP/static",
- "cd $$TMP",
- "zip -Drq $$ROOT/$@ -g .",
- ]),
- )