blob: 62d1d928dc85d9afdae83a1e6387102d07be8007 [file] [log] [blame]
Logan Hanks784849c2018-09-12 14:35:10 -07001load("@io_bazel_rules_go//go:def.bzl", "go_binary")
David Ostrovskyfa189072016-11-30 08:52:06 +01002load("//tools/bzl:genrule2.bzl", "genrule2")
Ben Rohlfs484ff8c2021-09-16 11:34:21 +02003load("//tools/bzl:js.bzl", "karma_test")
David Ostrovsky930f29e2019-01-08 23:11:59 +01004
5package(default_visibility = ["//visibility:public"])
Han-Wen Nienhuys28e7a6d2016-09-21 15:03:54 +02006
Han-Wen Nienhuys0d4ea732016-11-13 14:13:38 -08007genrule2(
David Ostrovskyfa189072016-11-30 08:52:06 +01008 name = "fonts",
9 srcs = [
Becky Siegel792e4182017-09-01 16:34:08 -070010 "//lib/fonts:robotofonts",
David Ostrovskyfa189072016-11-30 08:52:06 +010011 ],
12 outs = ["fonts.zip"],
13 cmd = " && ".join([
14 "mkdir -p $$TMP/fonts",
15 "cp $(SRCS) $$TMP/fonts/",
16 "cd $$TMP",
17 "find fonts/ -exec touch -t 198001010000 '{}' ';'",
18 "zip -qr $$ROOT/$@ fonts",
19 ]),
20 output_to_bindir = 1,
Han-Wen Nienhuys0d4ea732016-11-13 14:13:38 -080021)
Logan Hanks784849c2018-09-12 14:35:10 -070022
23go_binary(
24 name = "devserver",
25 srcs = ["server.go"],
26 data = [
27 ":fonts.zip",
Dmitrii Filippove629c9b2020-01-23 18:14:51 +010028 "@ui_dev_npm//:node_modules",
Dmitrii Filippovfe672872020-01-15 10:40:35 +010029 "@ui_npm//:node_modules",
Logan Hanks784849c2018-09-12 14:35:10 -070030 ],
31 deps = [
Logan Hanks784849c2018-09-12 14:35:10 -070032 "@org_golang_x_tools//godoc/vfs/httpfs:go_default_library",
33 "@org_golang_x_tools//godoc/vfs/zipfs:go_default_library",
34 ],
35)
Dmitrii Filippovacd39a22020-04-02 10:31:43 +020036
Dmitrii Filippovacd39a22020-04-02 10:31:43 +020037sh_binary(
38 name = "karma_bin",
39 srcs = ["@ui_dev_npm//:node_modules/karma/bin/karma"],
40 data = [
41 "@ui_dev_npm//@open-wc/karma-esm",
42 "@ui_dev_npm//chai",
43 "@ui_dev_npm//karma-chrome-launcher",
44 "@ui_dev_npm//karma-mocha",
45 "@ui_dev_npm//karma-mocha-reporter",
46 "@ui_dev_npm//karma/bin:karma",
47 "@ui_dev_npm//mocha",
48 ],
49)
50
Ben Rohlfs484ff8c2021-09-16 11:34:21 +020051karma_test(
Dmitrii Filippovacd39a22020-04-02 10:31:43 +020052 name = "karma_test",
Dmitrii Filippovacd39a22020-04-02 10:31:43 +020053 srcs = ["karma_test.sh"],
Ben Rohlfs484ff8c2021-09-16 11:34:21 +020054 data = ["//polygerrit-ui/app:test-srcs-fg"],
Dmitrii Filippovacd39a22020-04-02 10:31:43 +020055)