-
Notifications
You must be signed in to change notification settings - Fork 6.8k
/
Copy pathBUILD.bazel
93 lines (83 loc) · 2.71 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
load("//src/cdk:config.bzl", "CDK_ENTRYPOINTS", "CDK_ENTRYPOINTS_WITH_STYLES", "CDK_SCSS_LIBS", "CDK_TARGETS")
load("//tools:defaults.bzl", "ng_package", "sass_library")
load("//tools:defaults2.bzl", "ts_project")
load("//tools/bazel:legacy_target.bzl", "get_legacy_label")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
package(default_visibility = ["//visibility:public"])
npm_link_all_packages()
ts_project(
name = "cdk",
srcs = glob(
["*.ts"],
exclude = ["**/*.spec.ts"],
),
deps = ["//:node_modules/@angular/core"],
)
# List of style files that need to be copied to the root of the CDK package. We do this
# to make it easier for developers to import these styles without needing to know about
# deep imports in the release output. Note that this is done for backwards compatibility
# with the Gulp release output. TODO(devversion): consider removing this in the future.
prebuiltStyles = [file for target in CDK_ENTRYPOINTS_WITH_STYLES for file in [
[
"%s-prebuilt.css" % target,
target,
],
]]
# Create genrules that output prebuilt stylesheets for secondary entry-points with styles.
[genrule(
name = "%s_prebuilt" % file,
srcs = ["//src/cdk/%s:%s" % (target, file)],
outs = [file],
cmd = "cp $< $@",
) for [
file,
target,
] in prebuiltStyles]
# List of targets which generate the re-rooted stylesheet files.
prebuiltStyleTargets = ["%s_prebuilt" % file for [
file,
_,
] in prebuiltStyles]
sass_library(
name = "sass_lib",
srcs = ["_index.scss"],
deps = CDK_SCSS_LIBS,
)
# Creates the @angular/cdk package published to npm.
ng_package(
name = "npm_package",
package_name = "@angular/cdk",
srcs = [
"package.json",
":sass_lib",
] + prebuiltStyleTargets + CDK_SCSS_LIBS,
nested_packages = [
"//src/cdk/schematics:npm_package",
],
tags = ["release-package"],
visibility = [
"//:__pkg__",
"//goldens:__pkg__",
"//integration:__subpackages__",
],
deps = [get_legacy_label(t) for t in CDK_TARGETS],
)
filegroup(
name = "overviews",
# Only secondary entry-points declare overview files currently. Entry-points
# which contain a slash are not in the top-level and do not have an overview.
srcs = ["//src/cdk/%s:overview" % ep for ep in CDK_ENTRYPOINTS if not "/" in ep],
)
copy_to_directory(
name = "adev_json_apis",
srcs = [
"//src/cdk/testing:json_api",
"//src/cdk/testing/protractor:json_api",
"//src/cdk/testing/selenium-webdriver:json_api",
"//src/cdk/testing/testbed:json_api",
],
replace_prefixes = {
"**/": "",
},
)