gerrit/polygerrit-ui/BUILD
Logan Hanks 784849c2ca Bazelify the PolyGerrit dev server
Formerly, developers were directed to install Go and a specific
library dependency on their workstation. We can pull this all into bazel
using bazelbuild/rules_go and bazelbuild/bazel-gazelle.

Now, instead of running a script from a specific directory, the dev
server can be started with a simple "bazel run" command. Or, continue
using the script, which automatically releases the bazel lock before
starting the server.

Change-Id: I9dbda32a8c8698b3f43d02b2133d3cecbffaf1c3
2018-09-21 09:26:43 +02:00

72 lines
2.1 KiB
Python

package(
default_visibility = ["//visibility:public"],
)
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
load("//tools/bzl:js.bzl", "bower_component_bundle")
load("//tools/bzl:genrule2.bzl", "genrule2")
bower_component_bundle(
name = "polygerrit_components.bower_components",
deps = [
"//lib/js:ba-linkify",
"//lib/js:es6-promise",
"//lib/js:fetch",
# Although highlightjs is inserted separately in the UI zip, it's used
# by local development servers (e.g. --polygerrit-dev or run-server.sh).
"//lib/js:highlightjs",
"//lib/js:iron-a11y-keys-behavior",
"//lib/js:iron-autogrow-textarea",
"//lib/js:iron-dropdown",
"//lib/js:iron-icon",
"//lib/js:iron-iconset-svg",
"//lib/js:iron-input",
"//lib/js:iron-overlay-behavior",
"//lib/js:iron-selector",
"//lib/js:moment",
"//lib/js:page",
"//lib/js:paper-button",
"//lib/js:paper-input",
"//lib/js:paper-item",
"//lib/js:paper-listbox",
"//lib/js:paper-tabs",
"//lib/js:paper-toggle-button",
"//lib/js:polymer",
"//lib/js:polymer-resin",
"//lib/js:promise-polyfill",
],
)
genrule2(
name = "fonts",
srcs = [
"//lib/fonts:robotofonts",
],
outs = ["fonts.zip"],
cmd = " && ".join([
"mkdir -p $$TMP/fonts",
"cp $(SRCS) $$TMP/fonts/",
"cd $$TMP",
"find fonts/ -exec touch -t 198001010000 '{}' ';'",
"zip -qr $$ROOT/$@ fonts",
]),
output_to_bindir = 1,
visibility = ["//visibility:public"],
)
go_binary(
name = "devserver",
srcs = ["server.go"],
data = [
":fonts.zip",
"//polygerrit-ui/app:test_components.zip",
"//resources/com/google/gerrit/httpd/raw",
],
deps = [
"@com_github_robfig_soy//:go_default_library",
"@com_github_robfig_soy//soyhtml:go_default_library",
"@org_golang_x_tools//godoc/vfs/httpfs:go_default_library",
"@org_golang_x_tools//godoc/vfs/zipfs:go_default_library",
],
)