Skip to content

Commit 23b1f28

Browse files
committed
build: group examples by component entry-point
Groups the examples by package and entry-point name. This allows us have a bazel build target for each group and also allows us to separate MDC prototypes from standard implementations.
1 parent 37086fd commit 23b1f28

File tree

774 files changed

+3014
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

774 files changed

+3014
-261
lines changed

src/material-examples/BUILD.bazel

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,72 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("//:packages.bzl", "CDK_EXPERIMENTAL_TARGETS", "CDK_TARGETS", "MATERIAL_EXPERIMENTAL_TARGETS", "MATERIAL_PACKAGES", "ROLLUP_GLOBALS")
3+
load("//:packages.bzl", "ROLLUP_GLOBALS")
44
load("//tools:defaults.bzl", "ng_module", "ng_package")
55
load("//tools/highlight-files:index.bzl", "highlight_files")
66
load("//tools/package-docs-content:index.bzl", "package_docs_content")
77

8+
EXAMPLE_PACKAGES = [
9+
# TODO(devversion): try to have for each entry-point a bazel package so that
10+
# we can automate this using the "package.bzl" variables.
11+
"//src/material-examples/cdk/a11y",
12+
"//src/material-examples/cdk/drag-drop",
13+
"//src/material-examples/cdk/platform",
14+
"//src/material-examples/cdk/popover-edit",
15+
"//src/material-examples/cdk/portal",
16+
"//src/material-examples/cdk/scrolling",
17+
"//src/material-examples/cdk/stepper",
18+
"//src/material-examples/cdk/table",
19+
"//src/material-examples/cdk/text-field",
20+
"//src/material-examples/cdk/tree",
21+
"//src/material-examples/material/autocomplete",
22+
"//src/material-examples/material/badge",
23+
"//src/material-examples/material/bottom-sheet",
24+
"//src/material-examples/material/button",
25+
"//src/material-examples/material/button-toggle",
26+
"//src/material-examples/material/card",
27+
"//src/material-examples/material/checkbox",
28+
"//src/material-examples/material/chips",
29+
"//src/material-examples/material/core",
30+
"//src/material-examples/material/datepicker",
31+
"//src/material-examples/material/dialog",
32+
"//src/material-examples/material/divider",
33+
"//src/material-examples/material/expansion",
34+
"//src/material-examples/material/form-field",
35+
"//src/material-examples/material/grid-list",
36+
"//src/material-examples/material/icon",
37+
"//src/material-examples/material/input",
38+
"//src/material-examples/material/list",
39+
"//src/material-examples/material/menu",
40+
"//src/material-examples/material/paginator",
41+
"//src/material-examples/material/popover-edit",
42+
"//src/material-examples/material/progress-bar",
43+
"//src/material-examples/material/progress-spinner",
44+
"//src/material-examples/material/radio",
45+
"//src/material-examples/material/select",
46+
"//src/material-examples/material/sidenav",
47+
"//src/material-examples/material/slide-toggle",
48+
"//src/material-examples/material/slider",
49+
"//src/material-examples/material/snack-bar",
50+
"//src/material-examples/material/sort",
51+
"//src/material-examples/material/stepper",
52+
"//src/material-examples/material/table",
53+
"//src/material-examples/material/tabs",
54+
"//src/material-examples/material/toolbar",
55+
"//src/material-examples/material/tooltip",
56+
"//src/material-examples/material/tree",
57+
]
58+
859
ng_module(
960
name = "examples",
1061
# TODO(paul): re-add the example-module genfile once angular/angular#30259 is resolved.
1162
srcs = glob(["**/*.ts"]),
12-
assets = glob([
13-
"**/*.html",
14-
"**/*.css",
15-
]),
1663
module_name = "@angular/material-examples",
17-
# Specify the tsconfig that is also used by Gulp. We need to explicitly use this tsconfig
18-
# because in order to import Moment with TypeScript, some specific options need to be set.
19-
tsconfig = ":tsconfig-build.json",
20-
deps = [
21-
"@npm//@angular/animations",
22-
"@npm//@angular/common",
23-
"@npm//@angular/core",
24-
"@npm//@angular/forms",
25-
"@npm//moment",
26-
"//src/material-moment-adapter",
27-
] + CDK_TARGETS + CDK_EXPERIMENTAL_TARGETS + MATERIAL_EXPERIMENTAL_TARGETS + ["//src/material/%s" % p for p in MATERIAL_PACKAGES],
64+
deps = EXAMPLE_PACKAGES,
2865
)
2966

3067
filegroup(
3168
name = "example-source-files",
32-
srcs = glob([
33-
"*/*.html",
34-
"*/*.css",
35-
"*/*.ts",
36-
]),
69+
srcs = ["%s:source-files" % pkg for pkg in EXAMPLE_PACKAGES],
3770
)
3871

3972
highlight_files(
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load("//tools:defaults.bzl", "ng_module")
4+
5+
ng_module(
6+
name = "a11y",
7+
srcs = glob(["**/*.ts"]),
8+
assets = glob([
9+
"**/*.html",
10+
"**/*.css",
11+
]),
12+
deps = [
13+
"//src/cdk/a11y",
14+
"//src/material/select",
15+
],
16+
)
17+
18+
filegroup(
19+
name = "source-files",
20+
srcs = glob([
21+
"*/*.html",
22+
"*/*.css",
23+
"*/*.ts",
24+
]),
25+
)

0 commit comments

Comments
 (0)