3bd799538f
* stable-3.1: Bazel: Remove unused polygerrit-ui/app:bower_components rule Bazel: Make maven_jar rule forward compatible Bazel: Replace deprecated dependency mode LOOSE with PRUNE_LEGACY Fix parse error from repo settings page Replace 'Menlo' with 'SF Mono' `shift+r` should only be triggered on `keyup` Wrap file names into multiple lines if its too long Change-Id: I471f80f059520105dd12f27021d334b697d89229
165 lines
3.3 KiB
Python
165 lines
3.3 KiB
Python
load("//tools/bzl:genrule2.bzl", "genrule2")
|
|
load("//tools/bzl:js.bzl", "bower_component_bundle")
|
|
load(":rules.bzl", "polygerrit_bundle")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
polygerrit_bundle(
|
|
name = "polygerrit_ui",
|
|
srcs = glob(
|
|
[
|
|
"**/*.html",
|
|
"**/*.js",
|
|
],
|
|
exclude = [
|
|
"bower_components/**",
|
|
"test/**",
|
|
"**/*_test.html",
|
|
],
|
|
),
|
|
outs = ["polygerrit_ui.zip"],
|
|
app = "elements/gr-app.html",
|
|
)
|
|
|
|
bower_component_bundle(
|
|
name = "test_components",
|
|
testonly = True,
|
|
deps = [
|
|
"//lib/js:iron-test-helpers",
|
|
"//lib/js:test-fixture",
|
|
"//lib/js:web-component-tester",
|
|
"//polygerrit-ui:polygerrit_components.bower_components",
|
|
],
|
|
)
|
|
|
|
filegroup(
|
|
name = "pg_code",
|
|
srcs = glob(
|
|
[
|
|
"**/*.html",
|
|
"**/*.js",
|
|
],
|
|
exclude = [
|
|
"bower_components/**",
|
|
],
|
|
),
|
|
)
|
|
|
|
filegroup(
|
|
name = "pg_code_without_test",
|
|
srcs = glob(
|
|
[
|
|
"**/*.html",
|
|
"**/*.js",
|
|
],
|
|
exclude = [
|
|
"bower_components/**",
|
|
"**/*_test.html",
|
|
"test/**",
|
|
"samples/**",
|
|
],
|
|
),
|
|
)
|
|
|
|
genrule2(
|
|
name = "pg_code_zip",
|
|
srcs = [":pg_code"],
|
|
outs = ["pg_code.zip"],
|
|
cmd = " && ".join([
|
|
("tar -hcf- $(locations :pg_code) |" +
|
|
" tar --strip-components=2 -C $$TMP/ -xf-"),
|
|
"cd $$TMP",
|
|
"TZ=UTC",
|
|
"export TZ",
|
|
"find . -exec touch -t 198001010000 '{}' ';'",
|
|
"zip -rq $$ROOT/$@ *",
|
|
]),
|
|
)
|
|
|
|
sh_test(
|
|
name = "wct_test",
|
|
size = "enormous",
|
|
srcs = ["wct_test.sh"],
|
|
data = [
|
|
"test/common-test-setup.html",
|
|
"test/index.html",
|
|
":pg_code.zip",
|
|
":test_components.zip",
|
|
],
|
|
# Should not run sandboxed.
|
|
tags = [
|
|
"local",
|
|
"manual",
|
|
],
|
|
)
|
|
|
|
# TODO(taoalpha): alias to `npm run eslint` or just remove once CI moved to npm
|
|
sh_test(
|
|
name = "lint_test",
|
|
size = "large",
|
|
srcs = ["lint_test.sh"],
|
|
data = [
|
|
".eslintrc.json",
|
|
":pg_code",
|
|
],
|
|
# Should not run sandboxed.
|
|
tags = [
|
|
"local",
|
|
"manual",
|
|
],
|
|
)
|
|
|
|
sh_test(
|
|
name = "polylint_test",
|
|
size = "large",
|
|
srcs = ["polylint_test.sh"],
|
|
data = [
|
|
"polymer.json",
|
|
":pg_code_without_test",
|
|
"//polygerrit-ui:polygerrit_components.bower_components.zip",
|
|
],
|
|
# Should not run sandboxed.
|
|
tags = [
|
|
"local",
|
|
"manual",
|
|
],
|
|
)
|
|
|
|
DIRECTORIES = [
|
|
"admin",
|
|
"change",
|
|
"change-list",
|
|
"core",
|
|
"diff",
|
|
"edit",
|
|
"plugins",
|
|
"settings",
|
|
"shared",
|
|
"gr-app",
|
|
]
|
|
|
|
[sh_test(
|
|
name = "template_test_" + directory,
|
|
size = "enormous",
|
|
srcs = ["template_test.sh"],
|
|
args = [directory],
|
|
data = [
|
|
":pg_code",
|
|
":template_test_srcs",
|
|
"//polygerrit-ui:polygerrit_components.bower_components.zip",
|
|
],
|
|
tags = [
|
|
# Should not run sandboxed.
|
|
"local",
|
|
"template",
|
|
],
|
|
) for directory in DIRECTORIES]
|
|
|
|
filegroup(
|
|
name = "template_test_srcs",
|
|
srcs = [
|
|
"template_test_srcs/convert_for_template_tests.py",
|
|
"template_test_srcs/template_test.js",
|
|
],
|
|
)
|