build: upgrade bazel rules to latest (#20768)

Add enough BUILD files to make it possible to
`bazel build packages/core/test`

Also re-format BUILD.bazel files with Buildifier.
Add a CI lint check that they stay formatted.

PR Close #20768
This commit is contained in:
Alex Eagle
2017-12-06 06:56:49 -08:00
committed by Jason Aden
parent 073f485c72
commit ef534c0cc1
61 changed files with 757 additions and 131 deletions

View File

@ -0,0 +1,20 @@
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
ts_library(
name = "service-worker",
srcs = glob(
[
"*.ts",
"src/**/*.ts",
],
),
module_name = "@angular/service-worker",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common",
"//packages/core",
"@rxjs",
],
)

View File

@ -0,0 +1,21 @@
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
ts_library(
name = "worker",
srcs = glob(
[
"*.ts",
"src/**/*.ts",
],
exclude = ["main.ts"],
),
tsconfig = ":tsconfig.json",
)
ts_library(
name = "main",
srcs = ["main.ts"],
deps = [":worker"],
)

View File

@ -0,0 +1,28 @@
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
name = "test_lib",
testonly = 1,
srcs = glob(
["**/*.ts"],
),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/service-worker/worker",
"//packages/service-worker/worker/testing",
],
)
jasmine_node_test(
name = "test",
srcs = [],
# TODO(alxhub): re-enable when need for main() is removed
tags = ["manual"],
deps = [
":test_lib",
],
)

View File

@ -0,0 +1,15 @@
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
ts_library(
name = "testing",
testonly = 1,
srcs = glob(["**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/service-worker/worker",
"@rxjs",
],
)