/
BUILD.bazel
65 lines (59 loc) · 2.07 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
load(
"//src/material:config.bzl",
"MATERIAL_ENTRYPOINTS",
"MATERIAL_SCSS_LIBS",
"MATERIAL_TARGETS",
"MATERIAL_TESTING_TARGETS",
)
load("//tools:defaults.bzl", "ng_package", "sass_library", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "material",
srcs = ["index.ts"],
)
filegroup(
name = "overviews",
srcs = ["//src/material/%s:overview" % name for name in MATERIAL_ENTRYPOINTS],
)
sass_library(
name = "sass_lib",
srcs = [
"_index.scss",
],
deps = [
"//src/material/core:core_scss_lib",
"//src/material/core:theming_scss_lib",
],
)
# Generate the material `package.json` by adding all MDC dependencies
# from the project root to the `package-base.json` file. This is done to avoid
# duplication and make the update process of MDC dependencies more obvious.
# Note that we need to explicitly reference all individual `@material/` dependencies as
# our code imports from the individual dependencies (and not from the kitchen-sink package)
genrule(
name = "package_json",
srcs = ["package-base.json"],
outs = ["package.json"],
cmd = "$(execpath //tools/mdc-deps:add-to-package-json) $< > $@",
exec_tools = ["//tools/mdc-deps:add-to-package-json"],
)
# Creates the @angular/material package published to npm.
ng_package(
name = "npm_package",
srcs = [
":package_json",
":sass_lib",
"//src/material/core:theming_scss_lib",
"//src/material/prebuilt-themes:azure-blue",
"//src/material/prebuilt-themes:cyan-orange",
"//src/material/prebuilt-themes:deeppurple-amber",
"//src/material/prebuilt-themes:indigo-pink",
"//src/material/prebuilt-themes:magenta-violet",
"//src/material/prebuilt-themes:pink-bluegrey",
"//src/material/prebuilt-themes:purple-green",
"//src/material/prebuilt-themes:rose-red",
] + MATERIAL_SCSS_LIBS,
nested_packages = ["//src/material/schematics:npm_package"],
tags = ["release-package"],
deps = MATERIAL_TARGETS + MATERIAL_TESTING_TARGETS,
)