mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 10:11:50 +08:00
This commit updates the BUILD files to specify fine-grained node_module deps by replacing "@typings" comments with actual @npm node module. Moved tools/bazel.rc -> .bazelrc Removed "jasmine" typings from base tsconfig.json Added @bazel/karma to devDependencies, needed for `ts_web_test`
98 lines
2.4 KiB
Python
98 lines
2.4 KiB
Python
# Copyright Google Inc. All Rights Reserved.
|
|
#
|
|
# Use of this source code is governed by an MIT-style license that can be
|
|
# found in the LICENSE file at https://angular.io/license
|
|
|
|
licenses(["notice"]) # MIT
|
|
|
|
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
|
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
|
|
load("//tools:ts_json_schema.bzl", "ts_json_schema")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
# Create a list of Tuple("path/file.json", "path_file") to be used as rules
|
|
ALL_SCHEMA_TARGETS_PAIR = [
|
|
(x, x.replace("/", "_").replace("-", "_").replace(".json", ""))
|
|
for x in glob(["*/schema.json"])
|
|
]
|
|
|
|
# Create all the targets.
|
|
[
|
|
ts_json_schema(
|
|
name = name,
|
|
src = src,
|
|
)
|
|
for (src, name) in ALL_SCHEMA_TARGETS_PAIR
|
|
]
|
|
|
|
ALL_SCHEMA_DEPS = [":" + name for (_, name) in ALL_SCHEMA_TARGETS_PAIR]
|
|
|
|
ts_library(
|
|
name = "angular",
|
|
srcs = glob(
|
|
include = ["**/*.ts"],
|
|
exclude = [
|
|
"**/*_spec.ts",
|
|
"**/*_spec_large.ts",
|
|
"**/*_benchmark.ts",
|
|
# Also exclude templated files.
|
|
"*/files/**/*.ts",
|
|
"*/other-files/**/*.ts",
|
|
# Exclude test helpers.
|
|
"utility/test/**/*.ts"
|
|
],
|
|
),
|
|
deps = ALL_SCHEMA_DEPS + [
|
|
"//packages/angular_devkit/core",
|
|
"//packages/angular_devkit/schematics",
|
|
"//packages/angular_devkit/schematics:tasks",
|
|
"@rxjs",
|
|
"@rxjs//operators",
|
|
"@npm//@types/node",
|
|
"@npm//typescript",
|
|
],
|
|
)
|
|
|
|
|
|
ts_library(
|
|
name = "angular_test_lib",
|
|
srcs = glob(
|
|
include = [
|
|
"**/*_spec.ts",
|
|
"**/*_spec_large.ts",
|
|
"utility/test/**/*.ts"
|
|
],
|
|
),
|
|
data = glob(
|
|
include = [
|
|
"**/*.json",
|
|
"*/files/**",
|
|
"*/other-files/**",
|
|
]
|
|
),
|
|
deps = ALL_SCHEMA_DEPS + [
|
|
":angular",
|
|
"//packages/angular_devkit/core",
|
|
"//packages/angular_devkit/schematics",
|
|
"//packages/angular_devkit/schematics:testing",
|
|
"@rxjs",
|
|
"@rxjs//operators",
|
|
"@npm//@types/node",
|
|
"@npm//@types/jasmine",
|
|
"@npm//typescript",
|
|
],
|
|
testonly = True,
|
|
tsconfig = "//:tsconfig-test.json",
|
|
)
|
|
|
|
jasmine_node_test(
|
|
name = "angular_test",
|
|
srcs = [":angular_test_lib"],
|
|
deps = [
|
|
"@npm//jasmine",
|
|
"@npm//source-map",
|
|
"@npm//chokidar",
|
|
],
|
|
)
|