Skip to content

Commit d3a9a20

Browse files
devversionjelbourn
authored andcommitted
build: group examples by package and entry-point name (#16822)
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 c791926 commit d3a9a20

File tree

776 files changed

+3023
-262
lines changed

Some content is hidden

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

776 files changed

+3023
-262
lines changed

.circleci/bazel.rc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ common --announce_rc
99
# Save downloaded repositories in a location that can be cached by CircleCI. This helps us
1010
# speeding up the analysis time significantly with Bazel managed node dependencies on the CI.
1111
build --repository_cache=/home/circleci/bazel_repository_cache
12+
13+
# Workaround https://github.com/bazelbuild/bazel/issues/3645. Bazel doesn't calculate the
14+
# memory ceiling correctly when running under Docker. Limit Bazel to consuming resources that
15+
# fit in CircleCI "xlarge" class. https://circleci.com/docs/2.0/configuration-reference/#resource_class
16+
# Note that we use less than the available RAM as bazel only estimates memory for actions
17+
# and we don't want to accidentally run out of memory.
18+
build --local_ram_resources=14336
19+
build --local_cpu_resources=8

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
- *yarn_install
152152
- *setup_bazel_binary
153153

154-
- run: bazel build src/... --build_tag_filters=-docs-package
154+
- run: bazel build src/...
155155

156156
# --------------------------------------------------------------------------------------------
157157
# Job that runs ts-api-guardian against our API goldens in "tools/public_api_guard".

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)