Logan Hanks | 784849c | 2018-09-12 14:35:10 -0700 | [diff] [blame] | 1 | load("@io_bazel_rules_go//go:def.bzl", "go_binary") |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 2 | load("//tools/bzl:genrule2.bzl", "genrule2") |
Ben Rohlfs | 484ff8c | 2021-09-16 11:34:21 +0200 | [diff] [blame] | 3 | load("//tools/bzl:js.bzl", "karma_test") |
David Ostrovsky | 930f29e | 2019-01-08 23:11:59 +0100 | [diff] [blame] | 4 | |
| 5 | package(default_visibility = ["//visibility:public"]) |
Han-Wen Nienhuys | 28e7a6d | 2016-09-21 15:03:54 +0200 | [diff] [blame] | 6 | |
Han-Wen Nienhuys | 0d4ea73 | 2016-11-13 14:13:38 -0800 | [diff] [blame] | 7 | genrule2( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 8 | name = "fonts", |
| 9 | srcs = [ |
Becky Siegel | 792e418 | 2017-09-01 16:34:08 -0700 | [diff] [blame] | 10 | "//lib/fonts:robotofonts", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 11 | ], |
| 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 Nienhuys | 0d4ea73 | 2016-11-13 14:13:38 -0800 | [diff] [blame] | 21 | ) |
Logan Hanks | 784849c | 2018-09-12 14:35:10 -0700 | [diff] [blame] | 22 | |
| 23 | go_binary( |
| 24 | name = "devserver", |
| 25 | srcs = ["server.go"], |
| 26 | data = [ |
| 27 | ":fonts.zip", |
Dmitrii Filippov | e629c9b | 2020-01-23 18:14:51 +0100 | [diff] [blame] | 28 | "@ui_dev_npm//:node_modules", |
Dmitrii Filippov | fe67287 | 2020-01-15 10:40:35 +0100 | [diff] [blame] | 29 | "@ui_npm//:node_modules", |
Logan Hanks | 784849c | 2018-09-12 14:35:10 -0700 | [diff] [blame] | 30 | ], |
| 31 | deps = [ |
Logan Hanks | 784849c | 2018-09-12 14:35:10 -0700 | [diff] [blame] | 32 | "@org_golang_x_tools//godoc/vfs/httpfs:go_default_library", |
| 33 | "@org_golang_x_tools//godoc/vfs/zipfs:go_default_library", |
| 34 | ], |
| 35 | ) |
Dmitrii Filippov | acd39a2 | 2020-04-02 10:31:43 +0200 | [diff] [blame] | 36 | |
Dmitrii Filippov | acd39a2 | 2020-04-02 10:31:43 +0200 | [diff] [blame] | 37 | sh_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 Rohlfs | 484ff8c | 2021-09-16 11:34:21 +0200 | [diff] [blame] | 51 | karma_test( |
Dmitrii Filippov | acd39a2 | 2020-04-02 10:31:43 +0200 | [diff] [blame] | 52 | name = "karma_test", |
Dmitrii Filippov | acd39a2 | 2020-04-02 10:31:43 +0200 | [diff] [blame] | 53 | srcs = ["karma_test.sh"], |
Ben Rohlfs | 484ff8c | 2021-09-16 11:34:21 +0200 | [diff] [blame] | 54 | data = ["//polygerrit-ui/app:test-srcs-fg"], |
Dmitrii Filippov | acd39a2 | 2020-04-02 10:31:43 +0200 | [diff] [blame] | 55 | ) |