/
BUILD.bazel
55 lines (49 loc) · 1.6 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
load(
"//src/material-experimental:config.bzl",
"MATERIAL_EXPERIMENTAL_SCSS_LIBS",
"MATERIAL_EXPERIMENTAL_TARGETS",
"MATERIAL_EXPERIMENTAL_TESTING_TARGETS",
)
load("//tools:defaults.bzl", "ng_package", "sass_library", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "material-experimental",
srcs = glob(
["*.ts"],
exclude = ["**/*.spec.ts"],
),
deps = ["@npm//@angular/core"],
)
sass_library(
name = "theming_scss_lib",
srcs = MATERIAL_EXPERIMENTAL_SCSS_LIBS + [
"//src/material-experimental/theming:theming_scss_lib",
],
)
sass_library(
name = "sass_lib",
srcs = ["_index.scss"],
deps = [":theming_scss_lib"],
)
# Generate the material-experimental `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"],
)
ng_package(
name = "npm_package",
srcs = [
":package_json",
":sass_lib",
":theming_scss_lib",
],
tags = ["release-package"],
deps = MATERIAL_EXPERIMENTAL_TARGETS + MATERIAL_EXPERIMENTAL_TESTING_TARGETS,
)