From 8ba2f2259abcdd3d4ea6436748089847e5c84745 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 3 Jun 2019 20:19:45 +0200 Subject: [PATCH] build: add linting for bazel build files (#16090) --- .circleci/config.yml | 1 + WORKSPACE | 77 +++--- guides/BUILD.bazel | 6 +- package.json | 9 +- packages.bzl | 204 +++++++-------- scripts/circleci/lint-bazel-files.sh | 12 + src/BUILD.bazel | 46 ++-- src/a11y-demo/BUILD.bazel | 31 +-- src/cdk-experimental/BUILD.bazel | 39 +-- src/cdk-experimental/dialog/BUILD.bazel | 71 +++--- src/cdk-experimental/popover-edit/BUILD.bazel | 30 ++- src/cdk-experimental/scrolling/BUILD.bazel | 82 +++--- src/cdk/BUILD.bazel | 41 +-- src/cdk/a11y/BUILD.bazel | 87 ++++--- src/cdk/accordion/BUILD.bazel | 60 +++-- src/cdk/bidi/BUILD.bazel | 55 +++-- src/cdk/coercion/BUILD.bazel | 50 ++-- src/cdk/collections/BUILD.bazel | 53 ++-- src/cdk/drag-drop/BUILD.bazel | 71 +++--- src/cdk/keycodes/BUILD.bazel | 44 ++-- src/cdk/layout/BUILD.bazel | 61 +++-- src/cdk/observers/BUILD.bazel | 51 ++-- src/cdk/overlay/BUILD.bazel | 136 +++++----- src/cdk/platform/BUILD.bazel | 29 ++- src/cdk/portal/BUILD.bazel | 54 ++-- src/cdk/schematics/BUILD.bazel | 119 +++++---- src/cdk/schematics/testing/BUILD.bazel | 32 +-- src/cdk/scrolling/BUILD.bazel | 77 +++--- src/cdk/stepper/BUILD.bazel | 41 +-- src/cdk/table/BUILD.bazel | 69 +++--- src/cdk/testing/BUILD.bazel | 17 +- src/cdk/testing/e2e/BUILD.bazel | 8 +- src/cdk/text-field/BUILD.bazel | 81 +++--- src/cdk/tree/BUILD.bazel | 69 +++--- src/dev-app/BUILD.bazel | 88 ++++--- src/e2e-app/BUILD.bazel | 175 +++++++------ src/material-examples/BUILD.bazel | 129 +++++----- src/material-experimental/BUILD.bazel | 32 +-- .../mdc-button/BUILD.bazel | 61 +++-- .../mdc-card/BUILD.bazel | 77 +++--- .../mdc-checkbox/BUILD.bazel | 140 ++++++----- .../mdc-chips/BUILD.bazel | 97 ++++---- .../mdc-helpers/BUILD.bazel | 233 +++++++++--------- .../mdc-menu/BUILD.bazel | 142 ++++++----- .../mdc-radio/BUILD.bazel | 77 +++--- .../mdc-slide-toggle/BUILD.bazel | 136 +++++----- .../popover-edit/BUILD.bazel | 66 ++--- src/material-moment-adapter/BUILD.bazel | 84 ++++--- src/material/BUILD.bazel | 84 ++++--- src/material/autocomplete/BUILD.bazel | 119 +++++---- src/material/badge/BUILD.bazel | 81 +++--- src/material/bottom-sheet/BUILD.bazel | 105 ++++---- src/material/button-toggle/BUILD.bazel | 126 +++++----- src/material/button/BUILD.bazel | 126 +++++----- src/material/card/BUILD.bazel | 87 +++---- src/material/checkbox/BUILD.bazel | 140 ++++++----- src/material/chips/BUILD.bazel | 117 +++++---- src/material/core/BUILD.bazel | 173 +++++++------ src/material/datepicker/BUILD.bazel | 147 ++++++----- src/material/dialog/BUILD.bazel | 144 ++++++----- src/material/divider/BUILD.bazel | 73 +++--- src/material/expansion/BUILD.bazel | 148 ++++++----- src/material/form-field/BUILD.bazel | 131 +++++----- src/material/grid-list/BUILD.bazel | 114 +++++---- src/material/icon/BUILD.bazel | 120 +++++---- src/material/input/BUILD.bazel | 134 +++++----- src/material/list/BUILD.bazel | 140 ++++++----- src/material/menu/BUILD.bazel | 150 +++++------ src/material/paginator/BUILD.bazel | 89 ++++--- src/material/prebuilt-themes/BUILD.bazel | 34 +-- src/material/progress-bar/BUILD.bazel | 124 +++++----- src/material/progress-spinner/BUILD.bazel | 118 +++++---- src/material/radio/BUILD.bazel | 132 +++++----- src/material/schematics/BUILD.bazel | 115 +++++---- src/material/select/BUILD.bazel | 123 ++++----- src/material/sidenav/BUILD.bazel | 146 ++++++----- src/material/slide-toggle/BUILD.bazel | 138 ++++++----- src/material/slider/BUILD.bazel | 105 ++++---- src/material/snack-bar/BUILD.bazel | 107 ++++---- src/material/sort/BUILD.bazel | 87 ++++--- src/material/stepper/BUILD.bazel | 158 ++++++------ src/material/table/BUILD.bazel | 89 ++++--- src/material/tabs/BUILD.bazel | 200 ++++++++------- src/material/testing/BUILD.bazel | 16 +- src/material/toolbar/BUILD.bazel | 122 ++++----- src/material/tooltip/BUILD.bazel | 117 +++++---- src/material/tree/BUILD.bazel | 79 +++--- test/BUILD.bazel | 20 +- tools/BUILD.bazel | 33 +-- tools/axe-protractor/BUILD.bazel | 14 +- tools/defaults.bzl | 226 ++++++++--------- tools/dgeni/BUILD.bazel | 34 +-- tools/dgeni/index.bzl | 146 +++++------ tools/dgeni/templates/BUILD.bazel | 6 +- tools/example-module/BUILD.bazel | 30 +-- tools/highlight-files/BUILD.bazel | 24 +- tools/highlight-files/index.bzl | 110 +++++---- tools/markdown-to-html/BUILD.bazel | 32 ++- tools/markdown-to-html/index.bzl | 91 +++---- tools/package-docs-content/BUILD.bazel | 18 +- tools/package-docs-content/index.bzl | 121 ++++----- tools/public_api_guard/BUILD.bazel | 2 +- .../public_api_guard/generate-guard-tests.bzl | 44 ++-- tools/sass_bundle.bzl | 105 ++++---- tools/sass_generate_binaries.bzl | 20 +- yarn.lock | 24 ++ 106 files changed, 4941 insertions(+), 4167 deletions(-) create mode 100755 scripts/circleci/lint-bazel-files.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index e279b5f8813..ea70cffd611 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -258,6 +258,7 @@ jobs: - *restore_cache - *yarn_install + - run: ./scripts/circleci/lint-bazel-files.sh - run: yarn gulp ci:lint # ------------------------------------------------------------------------------------------- diff --git a/WORKSPACE b/WORKSPACE index a89bdbb144d..9d3a88a5dc0 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,17 +4,17 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Add NodeJS rules (explicitly used for sass bundle rules) http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "1db950bbd27fb2581866e307c0130983471d4c3cd49c46063a2503ca7b6770a4", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.29.0/rules_nodejs-0.29.0.tar.gz"], + name = "build_bazel_rules_nodejs", + sha256 = "1db950bbd27fb2581866e307c0130983471d4c3cd49c46063a2503ca7b6770a4", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.29.0/rules_nodejs-0.29.0.tar.gz"], ) # Add sass rules http_archive( - name = "io_bazel_rules_sass", - sha256 = "ea79647e5cd36867568d80811a951c7b3170791058f50a5cbd3d542627e78881", - url = "https://github.com/bazelbuild/rules_sass/archive/1.17.3.zip", - strip_prefix = "rules_sass-1.17.3", + name = "io_bazel_rules_sass", + sha256 = "ea79647e5cd36867568d80811a951c7b3170791058f50a5cbd3d542627e78881", + strip_prefix = "rules_sass-1.17.3", + url = "https://github.com/bazelbuild/rules_sass/archive/1.17.3.zip", ) load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install") @@ -23,73 +23,82 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_reposi check_bazel_version("0.18.0") node_repositories( - # For deterministic builds, specify explicit NodeJS and Yarn versions. - node_version = "10.13.0", - # Use latest yarn version to support integrity field (added in yarn 1.10) - yarn_version = "1.12.1", + # For deterministic builds, specify explicit NodeJS and Yarn versions. + node_version = "10.13.0", + # Use latest yarn version to support integrity field (added in yarn 1.10) + yarn_version = "1.12.1", ) yarn_install( - name = "npm", - package_json = "//:package.json", - # Ensure that the script is available when running `postinstall` in the Bazel sandbox. - data = [ - "//:tools/npm/check-npm.js", - "//:angular-tsconfig.json", - ], - yarn_lock = "//:yarn.lock", + name = "npm", + # Ensure that the script is available when running `postinstall` in the Bazel sandbox. + data = [ + "//:angular-tsconfig.json", + "//:tools/npm/check-npm.js", + ], + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) # Install all bazel dependencies of the @ngdeps npm packages load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + install_bazel_dependencies() # Setup TypeScript Bazel workspace load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") + ts_setup_workspace() # Fetch transitive dependencies which are needed to use the karma rules. load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") + rules_karma_dependencies() # Setup web testing. We need to setup a browser because the web testing rules for TypeScript need # a reference to a registered browser (ideally that's a hermetic version of a browser) load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") + web_test_repositories() load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") + browser_repositories() # Fetch transitive dependencies which are needed to use the Sass rules. load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies") + rules_sass_dependencies() # Setup the Sass rule repositories. load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories") + sass_repositories() # Bring in bazel_toolchains for RBE setup configuration. http_archive( - name = "bazel_toolchains", - sha256 = "67335b3563d9b67dc2550b8f27cc689b64fadac491e69ce78763d9ba894cc5cc", - strip_prefix = "bazel-toolchains-cddc376d428ada2927ad359211c3e356bd9c9fbb", - url = "https://github.com/bazelbuild/bazel-toolchains/archive/cddc376d428ada2927ad359211c3e356bd9c9fbb.tar.gz", + name = "bazel_toolchains", + sha256 = "67335b3563d9b67dc2550b8f27cc689b64fadac491e69ce78763d9ba894cc5cc", + strip_prefix = "bazel-toolchains-cddc376d428ada2927ad359211c3e356bd9c9fbb", + url = "https://github.com/bazelbuild/bazel-toolchains/archive/cddc376d428ada2927ad359211c3e356bd9c9fbb.tar.gz", ) load("@bazel_toolchains//repositories:repositories.bzl", bazel_toolchains_repositories = "repositories") + bazel_toolchains_repositories() load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig") + rbe_autoconfig( - name = "rbe_default", - # We can't use the default "ubuntu16_04" RBE image provided by the autoconfig because we need - # a specific Linux kernel that comes with "libx11" in order to run headless browser tests. - repository = "asci-toolchain/nosla-ubuntu16_04-webtest", - registry = "gcr.io", - digest = "sha256:e874885f5e3d9ac0c0d3176e5369cb5969467dbf9ad8d42b862829cec8d84b9b", - # Need to specify a base container digest in order to ensure that we can use the checked-in - # platform configurations for the "ubuntu16_04" image. Otherwise the autoconfig rule would - # need to pull the image and run it in order determine the toolchain configuration. - # See: https://github.com/bazelbuild/bazel-toolchains/blob/master/rules/rbe_repo.bzl#L229 - base_container_digest = "sha256:da0f21c71abce3bbb92c3a0c44c3737f007a82b60f8bd2930abc55fe64fc2729", + name = "rbe_default", + # Need to specify a base container digest in order to ensure that we can use the checked-in + # platform configurations for the "ubuntu16_04" image. Otherwise the autoconfig rule would + # need to pull the image and run it in order determine the toolchain configuration. + # See: https://github.com/bazelbuild/bazel-toolchains/blob/master/rules/rbe_repo.bzl#L229 + base_container_digest = "sha256:da0f21c71abce3bbb92c3a0c44c3737f007a82b60f8bd2930abc55fe64fc2729", + digest = "sha256:e874885f5e3d9ac0c0d3176e5369cb5969467dbf9ad8d42b862829cec8d84b9b", + registry = "gcr.io", + # We can't use the default "ubuntu16_04" RBE image provided by the autoconfig because we need + # a specific Linux kernel that comes with "libx11" in order to run headless browser tests. + repository = "asci-toolchain/nosla-ubuntu16_04-webtest", ) diff --git a/guides/BUILD.bazel b/guides/BUILD.bazel index ceae91cd5a1..b785246ab85 100644 --- a/guides/BUILD.bazel +++ b/guides/BUILD.bazel @@ -1,8 +1,8 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("//tools:defaults.bzl", "markdown_to_html") markdown_to_html( - name = "guides", - srcs = glob(["**/*.md"]), + name = "guides", + srcs = glob(["**/*.md"]), ) diff --git a/package.json b/package.json index f711d0f99e7..f8ffbf47f89 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,11 @@ "scripts": { "postinstall": "ngc -p angular-tsconfig.json", "build": "gulp build-release-packages", + "bazel:buildifier": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,output-group,package-name,package-on-top,redefined-variable,repository-name,same-origin-load,string-iteration,unused-variable", + "bazel:format-lint": "yarn -s bazel:buildifier --lint=warn --mode=check", "dev-app": "gulp serve:devapp", "test": "bazel test //src/... --test_tag_filters=-e2e", - "lint": "gulp lint", + "lint": "gulp lint && yarn -s bazel:format-lint", "e2e": "bazel test //src/... --test_tag_filters=e2e", "deploy": "gulp deploy:devapp", "webdriver-manager": "webdriver-manager", @@ -26,7 +28,9 @@ "publish-release": "ts-node --project tools/release/ tools/release/publish-release.ts", "check-release-output": "ts-node --project tools/release tools/release/check-release-output.ts", "preinstall": "node ./tools/npm/check-npm.js", - "format": "git-clang-format HEAD $(git diff HEAD --name-only | grep -v \"\\.d\\.ts\")" + "format:ts": "git-clang-format HEAD $(git diff HEAD --name-only | grep -v \"\\.d\\.ts\")", + "format:bazel": "yarn -s bazel:buildifier --lint=fix --mode=fix", + "format": "yarn -s format:ts && yarn -s format:bazel" }, "version": "8.0.0", "requiredAngularVersion": "^8.0.0 || ^9.0.0-0", @@ -39,6 +43,7 @@ "@angular/elements": "^8.0.0", "@angular/forms": "^8.0.0", "@angular/platform-browser": "^8.0.0", + "@bazel/buildifier": "^0.25.1", "@webcomponents/custom-elements": "^1.1.0", "core-js": "^2.6.1", "material-components-web": "^1.1.0", diff --git a/packages.bzl b/packages.bzl index f5c9c0772b5..ab44cad67e8 100644 --- a/packages.bzl +++ b/packages.bzl @@ -1,73 +1,74 @@ # List of all components / subpackages. CDK_PACKAGES = [ - "a11y", - "accordion", - "bidi", - "coercion", - "collections", - "drag-drop", - "keycodes", - "layout", - "observers", - "overlay", - "platform", - "portal", - "scrolling", - "stepper", - "table", - "text-field", - "tree", + "a11y", + "accordion", + "bidi", + "coercion", + "collections", + "drag-drop", + "keycodes", + "layout", + "observers", + "overlay", + "platform", + "portal", + "scrolling", + "stepper", + "table", + "text-field", + "tree", ] CDK_TARGETS = ["//src/cdk"] + ["//src/cdk/%s" % p for p in CDK_PACKAGES] CDK_EXPERIMENTAL_PACKAGES = [ - "dialog", - "popover-edit", - "scrolling", + "dialog", + "popover-edit", + "scrolling", ] CDK_EXPERIMENTAL_TARGETS = ["//src/cdk-experimental"] + [ - "//src/cdk-experimental/%s" % p for p in CDK_EXPERIMENTAL_PACKAGES + "//src/cdk-experimental/%s" % p + for p in CDK_EXPERIMENTAL_PACKAGES ] MATERIAL_PACKAGES = [ - "autocomplete", - "badge", - "bottom-sheet", - "button", - "button-toggle", - "card", - "checkbox", - "chips", - "core", - "datepicker", - "dialog", - "divider", - "expansion", - "form-field", - "grid-list", - "icon", - "input", - "list", - "menu", - "paginator", - "progress-bar", - "progress-spinner", - "radio", - "select", - "sidenav", - "slide-toggle", - "slider", - "snack-bar", - "sort", - "stepper", - "table", - "tabs", - "toolbar", - "tooltip", - "tree", + "autocomplete", + "badge", + "bottom-sheet", + "button", + "button-toggle", + "card", + "checkbox", + "chips", + "core", + "datepicker", + "dialog", + "divider", + "expansion", + "form-field", + "grid-list", + "icon", + "input", + "list", + "menu", + "paginator", + "progress-bar", + "progress-spinner", + "radio", + "select", + "sidenav", + "slide-toggle", + "slider", + "snack-bar", + "sort", + "stepper", + "table", + "tabs", + "toolbar", + "tooltip", + "tree", ] MATERIAL_TARGETS = ["//src/material:material"] + ["//src/material/%s" % p for p in MATERIAL_PACKAGES] @@ -75,27 +76,30 @@ MATERIAL_TARGETS = ["//src/material:material"] + ["//src/material/%s" % p for p # List that references the sass libraries for each Material package. This can be used to create # the theming scss-bundle or to specify dependencies for the all-theme.scss file. MATERIAL_SCSS_LIBS = [ - "//src/material/%s:%s_scss_lib" % (p, p.replace('-', '_')) for p in MATERIAL_PACKAGES + "//src/material/%s:%s_scss_lib" % (p, p.replace("-", "_")) + for p in MATERIAL_PACKAGES ] MATERIAL_EXPERIMENTAL_PACKAGES = [ - "mdc-button", - "mdc-card", - "mdc-checkbox", - "mdc-chips", - "mdc-helpers", - "mdc-menu", - "mdc-radio", - "mdc-slide-toggle", - "popover-edit", + "mdc-button", + "mdc-card", + "mdc-checkbox", + "mdc-chips", + "mdc-helpers", + "mdc-menu", + "mdc-radio", + "mdc-slide-toggle", + "popover-edit", ] MATERIAL_EXPERIMENTAL_TARGETS = ["//src/material-experimental"] + [ - "//src/material-experimental/%s" % p for p in MATERIAL_EXPERIMENTAL_PACKAGES + "//src/material-experimental/%s" % p + for p in MATERIAL_EXPERIMENTAL_PACKAGES ] MATERIAL_EXPERIMENTAL_SCSS_LIBS = [ - "//src/material-experimental/%s:%s_scss_lib" % (p, p.replace('-', '_')) for p in MATERIAL_EXPERIMENTAL_PACKAGES + "//src/material-experimental/%s:%s_scss_lib" % (p, p.replace("-", "_")) + for p in MATERIAL_EXPERIMENTAL_PACKAGES ] # Each individual package uses a placeholder for the version of Angular to ensure they're @@ -104,59 +108,63 @@ MATERIAL_EXPERIMENTAL_SCSS_LIBS = [ ANGULAR_PACKAGE_VERSION = "^8.0.0 || ^9.0.0-0" MDC_PACKAGE_VERSION = "^1.1.0" VERSION_PLACEHOLDER_REPLACEMENTS = { - "0.0.0-NG": ANGULAR_PACKAGE_VERSION, - "0.0.0-MDC": MDC_PACKAGE_VERSION + "0.0.0-NG": ANGULAR_PACKAGE_VERSION, + "0.0.0-MDC": MDC_PACKAGE_VERSION, } # Base rollup globals for everything in the repo. ROLLUP_GLOBALS = { - 'tslib': 'tslib', - 'moment': 'moment', - '@angular/cdk': 'ng.cdk', - '@angular/cdk-experimental': 'ng.cdkExperimental', - '@angular/material': 'ng.material', - '@angular/material-experimental': 'ng.materialExperimental', + "tslib": "tslib", + "moment": "moment", + "@angular/cdk": "ng.cdk", + "@angular/cdk-experimental": "ng.cdkExperimental", + "@angular/material": "ng.material", + "@angular/material-experimental": "ng.materialExperimental", } # Rollup globals for cdk subpackages in the form of, e.g., {"@angular/cdk/table": "ng.cdk.table"} ROLLUP_GLOBALS.update({ - "@angular/cdk/%s" % p: "ng.cdk.%s" % p for p in CDK_PACKAGES + "@angular/cdk/%s" % p: "ng.cdk.%s" % p + for p in CDK_PACKAGES }) # Rollup globals for cdk subpackages in the form of, e.g., # {"@angular/cdk-experimental/scrolling": "ng.cdkExperimental.scrolling"} ROLLUP_GLOBALS.update({ - "@angular/cdk-experimental/%s" % p: "ng.cdkExperimental.%s" % p for p in CDK_EXPERIMENTAL_PACKAGES + "@angular/cdk-experimental/%s" % p: "ng.cdkExperimental.%s" % p + for p in CDK_EXPERIMENTAL_PACKAGES }) # Rollup globals for material subpackages, e.g., {"@angular/material/list": "ng.material.list"} ROLLUP_GLOBALS.update({ - "@angular/material/%s" % p: "ng.material.%s" % p for p in MATERIAL_PACKAGES + "@angular/material/%s" % p: "ng.material.%s" % p + for p in MATERIAL_PACKAGES }) # Rollup globals for material experiemental subpackages, e.g., {"@angular/material-experimental/list": "ng.materialExperimental.list"} ROLLUP_GLOBALS.update({ - "@angular/material-experiemntal/%s" % p: "ng.materialExperimental.%s" % p for p in MATERIAL_EXPERIMENTAL_PACKAGES + "@angular/material-experiemntal/%s" % p: "ng.materialExperimental.%s" % p + for p in MATERIAL_EXPERIMENTAL_PACKAGES }) # UMD bundles for Angular packages and subpackges we depend on for development and testing. ANGULAR_LIBRARY_UMDS = [ - "@npm//node_modules/@angular/animations:bundles/animations-browser.umd.js", - "@npm//node_modules/@angular/animations:bundles/animations.umd.js", - "@npm//node_modules/@angular/common:bundles/common-http-testing.umd.js", - "@npm//node_modules/@angular/common:bundles/common-http.umd.js", - "@npm//node_modules/@angular/common:bundles/common-testing.umd.js", - "@npm//node_modules/@angular/common:bundles/common.umd.js", - "@npm//node_modules/@angular/compiler:bundles/compiler-testing.umd.js", - "@npm//node_modules/@angular/compiler:bundles/compiler.umd.js", - "@npm//node_modules/@angular/core:bundles/core-testing.umd.js", - "@npm//node_modules/@angular/core:bundles/core.umd.js", - "@npm//node_modules/@angular/elements:bundles/elements.umd.js", - "@npm//node_modules/@angular/forms:bundles/forms.umd.js", - "@npm//node_modules/@angular/platform-browser-dynamic:bundles/platform-browser-dynamic-testing.umd.js", - "@npm//node_modules/@angular/platform-browser-dynamic:bundles/platform-browser-dynamic.umd.js", - "@npm//node_modules/@angular/platform-browser:bundles/platform-browser-animations.umd.js", - "@npm//node_modules/@angular/platform-browser:bundles/platform-browser-testing.umd.js", - "@npm//node_modules/@angular/platform-browser:bundles/platform-browser.umd.js", - "@npm//node_modules/@angular/router:bundles/router.umd.js", + "@npm//node_modules/@angular/animations:bundles/animations-browser.umd.js", + "@npm//node_modules/@angular/animations:bundles/animations.umd.js", + "@npm//node_modules/@angular/common:bundles/common-http-testing.umd.js", + "@npm//node_modules/@angular/common:bundles/common-http.umd.js", + "@npm//node_modules/@angular/common:bundles/common-testing.umd.js", + "@npm//node_modules/@angular/common:bundles/common.umd.js", + "@npm//node_modules/@angular/compiler:bundles/compiler-testing.umd.js", + "@npm//node_modules/@angular/compiler:bundles/compiler.umd.js", + "@npm//node_modules/@angular/core:bundles/core-testing.umd.js", + "@npm//node_modules/@angular/core:bundles/core.umd.js", + "@npm//node_modules/@angular/elements:bundles/elements.umd.js", + "@npm//node_modules/@angular/forms:bundles/forms.umd.js", + "@npm//node_modules/@angular/platform-browser-dynamic:bundles/platform-browser-dynamic-testing.umd.js", + "@npm//node_modules/@angular/platform-browser-dynamic:bundles/platform-browser-dynamic.umd.js", + "@npm//node_modules/@angular/platform-browser:bundles/platform-browser-animations.umd.js", + "@npm//node_modules/@angular/platform-browser:bundles/platform-browser-testing.umd.js", + "@npm//node_modules/@angular/platform-browser:bundles/platform-browser.umd.js", + "@npm//node_modules/@angular/router:bundles/router.umd.js", ] diff --git a/scripts/circleci/lint-bazel-files.sh b/scripts/circleci/lint-bazel-files.sh new file mode 100755 index 00000000000..99c1cf2ac52 --- /dev/null +++ b/scripts/circleci/lint-bazel-files.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# ANSI code variables which can be used to print a colored message. +RED='\033[0;31m' +YELLOW='\033[0;33m' + +yarn -s bazel:format-lint || { + echo "" + echo -e "${RED}Please fix all warnings. Some warnings can" \ + "be fixed automatically by running: ${YELLOW}yarn bazel:format" + exit 1 +} diff --git a/src/BUILD.bazel b/src/BUILD.bazel index fcc22e76e98..3a33e28608a 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -6,34 +6,36 @@ load("//tools/dgeni:index.bzl", "dgeni_api_docs") # List that contains all source files that need to be processed by Dgeni. apiSourceFiles = ["//src/cdk/%s:source-files" % name for name in CDK_PACKAGES] + [ - "//src/material/%s:source-files" % name for name in MATERIAL_PACKAGES] + "//src/material/%s:source-files" % name + for name in MATERIAL_PACKAGES +] exports_files([ - "bazel-tsconfig-build.json", - "bazel-tsconfig-test.json", - "README.md", + "bazel-tsconfig-build.json", + "bazel-tsconfig-test.json", + "README.md", ]) ts_library( - name = 'module-typings', - srcs = [":module-typings.d.ts"] + name = "module-typings", + srcs = [":module-typings.d.ts"], ) dgeni_api_docs( - name = "api-docs", - srcs = apiSourceFiles + [ - # Add all Angular packages to the sources because some Material exports use - # Angular exports and these should not cause any warnings when Dgeni uses the - # type checker to parse our TypeScript sources. - "@npm//@angular/core", - "@npm//@angular/common", - "@npm//@angular/forms", - "@npm//@angular/animations", - "@npm//@angular/platform-browser", - ], - entry_points = { - "cdk": CDK_PACKAGES, - "material": MATERIAL_PACKAGES, - }, - tags = ["docs-package"], + name = "api-docs", + srcs = apiSourceFiles + [ + # Add all Angular packages to the sources because some Material exports use + # Angular exports and these should not cause any warnings when Dgeni uses the + # type checker to parse our TypeScript sources. + "@npm//@angular/core", + "@npm//@angular/common", + "@npm//@angular/forms", + "@npm//@angular/animations", + "@npm//@angular/platform-browser", + ], + entry_points = { + "cdk": CDK_PACKAGES, + "material": MATERIAL_PACKAGES, + }, + tags = ["docs-package"], ) diff --git a/src/a11y-demo/BUILD.bazel b/src/a11y-demo/BUILD.bazel index 22a7e5403c5..45d8356f432 100644 --- a/src/a11y-demo/BUILD.bazel +++ b/src/a11y-demo/BUILD.bazel @@ -1,22 +1,25 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//:packages.bzl", "MATERIAL_TARGETS", "CDK_TARGETS") +load("//:packages.bzl", "CDK_TARGETS", "MATERIAL_TARGETS") load("//tools:defaults.bzl", "ng_module") load("//tools:sass_generate_binaries.bzl", "sass_generate_binaries") # Generate sass binaries for all nested SCSS files. -sass_generate_binaries("a11y_demo_scss", glob(["**/*.scss"])) +sass_generate_binaries( + "a11y_demo_scss", + glob(["**/*.scss"]), +) ng_module( - name = "a11y-demo", - srcs = glob(["**/*.ts"]), - assets = glob(["**/*.html"]) + [":a11y_demo_scss"], - deps = [ - "@npm//rxjs", - "@npm//@angular/core", - "@npm//@angular/common", - "@npm//@angular/animations", - "@npm//@angular/forms", - "@npm//@angular/router", - ] + CDK_TARGETS + MATERIAL_TARGETS + name = "a11y-demo", + srcs = glob(["**/*.ts"]), + assets = glob(["**/*.html"]) + [":a11y_demo_scss"], + deps = [ + "@npm//rxjs", + "@npm//@angular/core", + "@npm//@angular/common", + "@npm//@angular/animations", + "@npm//@angular/forms", + "@npm//@angular/router", + ] + CDK_TARGETS + MATERIAL_TARGETS, ) diff --git a/src/cdk-experimental/BUILD.bazel b/src/cdk-experimental/BUILD.bazel index a3fdf8fea86..e77f5e44eae 100644 --- a/src/cdk-experimental/BUILD.bazel +++ b/src/cdk-experimental/BUILD.bazel @@ -1,24 +1,31 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("//tools:defaults.bzl", "ng_module", "ng_package") -load("//:packages.bzl", "CDK_EXPERIMENTAL_PACKAGES", "CDK_EXPERIMENTAL_TARGETS", - "CDK_TARGETS", "ROLLUP_GLOBALS") +load( + "//:packages.bzl", + "CDK_EXPERIMENTAL_PACKAGES", + "CDK_EXPERIMENTAL_TARGETS", + "ROLLUP_GLOBALS", +) ng_module( - name = "cdk-experimental", - srcs = glob(["*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk-experimental", - deps = ["//src/cdk-experimental/%s" % p for p in CDK_EXPERIMENTAL_PACKAGES], + name = "cdk-experimental", + srcs = glob( + ["*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk-experimental", + deps = ["//src/cdk-experimental/%s" % p for p in CDK_EXPERIMENTAL_PACKAGES], ) ng_package( - name = "npm_package", - srcs = ["package.json"], - entry_point = "src/cdk-experimental/public_api.js", - globals = ROLLUP_GLOBALS, - deps = CDK_EXPERIMENTAL_TARGETS, - # TODO(devversion): Use the npm package for publishing. Right now this is disabled because - # we build using AOT for serving & testing, but the `ng_package` rule should not include factory - # files. - tags = ["manual"], + name = "npm_package", + srcs = ["package.json"], + entry_point = "src/cdk-experimental/public_api.js", + globals = ROLLUP_GLOBALS, + # TODO(devversion): Use the npm package for publishing. Right now this is disabled because + # we build using AOT for serving & testing, but the `ng_package` rule should not include factory + # files. + tags = ["manual"], + deps = CDK_EXPERIMENTAL_TARGETS, ) diff --git a/src/cdk-experimental/dialog/BUILD.bazel b/src/cdk-experimental/dialog/BUILD.bazel index 240e4bbead8..77517fb2fce 100644 --- a/src/cdk-experimental/dialog/BUILD.bazel +++ b/src/cdk-experimental/dialog/BUILD.bazel @@ -1,47 +1,52 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite") ng_module( - name = "dialog", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk-experimental/dialog", - assets = [":dialog-container.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/portal", - ], + name = "dialog", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":dialog-container.css"] + glob(["**/*.html"]), + module_name = "@angular/cdk-experimental/dialog", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/portal", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_binary( - name = "dialog_container_scss", - src = "dialog-container.scss", + name = "dialog_container_scss", + src = "dialog-container.scss", ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/platform-browser", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/testing", - ":dialog", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":dialog", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/testing", + "@npm//@angular/common", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"] + name = "unit_tests", + deps = [":unit_test_sources"], ) - diff --git a/src/cdk-experimental/popover-edit/BUILD.bazel b/src/cdk-experimental/popover-edit/BUILD.bazel index ac4d3586076..6b6db8862d5 100644 --- a/src/cdk-experimental/popover-edit/BUILD.bazel +++ b/src/cdk-experimental/popover-edit/BUILD.bazel @@ -4,36 +4,42 @@ load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite" ng_module( name = "popover-edit", - srcs = glob(["**/*.ts"], exclude = ["**/*.spec.ts"]), + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), module_name = "@angular/cdk-experimental/popover-edit", deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/portal", + "//src/cdk/scrolling", "@npm//@angular/common", "@npm//@angular/core", "@npm//@angular/forms", "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/overlay", - "//src/cdk/scrolling", - "//src/cdk/keycodes", - "//src/cdk/portal", ], ) ng_test_library( name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), deps = [ ":popover-edit", - "@npm//@angular/common", - "@npm//@angular/forms", - "@npm//rxjs", "//src/cdk/bidi", "//src/cdk/collections", "//src/cdk/keycodes", + "//src/cdk/overlay", "//src/cdk/table", "//src/cdk/testing", - "//src/cdk/overlay", + "@npm//@angular/common", + "@npm//@angular/forms", + "@npm//rxjs", ], ) diff --git a/src/cdk-experimental/scrolling/BUILD.bazel b/src/cdk-experimental/scrolling/BUILD.bazel index 7c8234b1e26..fc971620c50 100644 --- a/src/cdk-experimental/scrolling/BUILD.bazel +++ b/src/cdk-experimental/scrolling/BUILD.bazel @@ -1,55 +1,61 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", "ng_e2e_test_library") +load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "ng_test_library", "ng_web_test_suite") ng_module( - name = "scrolling", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk-experimental/scrolling", - deps = [ - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/coercion", - "//src/cdk/collections", - "//src/cdk/scrolling", - ], + name = "scrolling", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk-experimental/scrolling", + deps = [ + "//src/cdk/coercion", + "//src/cdk/collections", + "//src/cdk/scrolling", + "@npm//@angular/core", + "@npm//rxjs", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/scrolling", - ":scrolling", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":scrolling", + "//src/cdk/scrolling", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"] + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) diff --git a/src/cdk/BUILD.bazel b/src/cdk/BUILD.bazel index b3dc5d0277e..7b50bc8758b 100644 --- a/src/cdk/BUILD.bazel +++ b/src/cdk/BUILD.bazel @@ -1,32 +1,35 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//:packages.bzl", "CDK_TARGETS", "CDK_PACKAGES", "ROLLUP_GLOBALS") +load("//:packages.bzl", "CDK_PACKAGES", "CDK_TARGETS", "ROLLUP_GLOBALS") load("//tools:defaults.bzl", "ng_module", "ng_package") # Root "@angular/cdk" entry-point that does not re-export individual entry-points. ng_module( - name = "cdk", - srcs = glob(["*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk", - deps = [ - "@npm//@angular/core", - ], + name = "cdk", + srcs = glob( + ["*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk", + deps = [ + "@npm//@angular/core", + ], ) filegroup( - name = "overviews", - srcs = ["//src/cdk/%s:overview" % name for name in CDK_PACKAGES] + name = "overviews", + srcs = ["//src/cdk/%s:overview" % name for name in CDK_PACKAGES], ) # Creates the @angular/cdk package published to npm. ng_package( - name = "npm_package", - srcs = ["package.json"], - entry_point = "src/cdk/public_api.js", - globals = ROLLUP_GLOBALS, - deps = CDK_TARGETS, - # TODO(devversion): Use the npm package for publishing. Right now this is disabled because - # we build using AOT for serving & testing, but the `ng_package` rule should not include factory - # files. - tags = ["manual"], + name = "npm_package", + srcs = ["package.json"], + entry_point = "src/cdk/public_api.js", + globals = ROLLUP_GLOBALS, + # TODO(devversion): Use the npm package for publishing. Right now this is disabled because + # we build using AOT for serving & testing, but the `ng_package` rule should not include factory + # files. + tags = ["manual"], + deps = CDK_TARGETS, ) diff --git a/src/cdk/a11y/BUILD.bazel b/src/cdk/a11y/BUILD.bazel index 05db3cd515d..4dcaea7ea3c 100644 --- a/src/cdk/a11y/BUILD.bazel +++ b/src/cdk/a11y/BUILD.bazel @@ -1,60 +1,71 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "a11y", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/a11y", - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/cdk/observers", - "//src/cdk/platform", - ] + name = "a11y", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/a11y", + deps = [ + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/cdk/observers", + "//src/cdk/platform", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "a11y_scss_lib", - srcs = glob(["**/_*.scss"]), + name = "a11y_scss_lib", + srcs = glob(["**/_*.scss"]), ) sass_binary( - name = "a11y_prebuilt_scss", - src = "a11y-prebuilt.scss", - deps = [":a11y_scss_lib"] + name = "a11y_prebuilt_scss", + src = "a11y-prebuilt.scss", + deps = [":a11y_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/keycodes", - "//src/cdk/observers", - "//src/cdk/platform", - "//src/cdk/testing", - ":a11y", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":a11y", + "//src/cdk/keycodes", + "//src/cdk/observers", + "//src/cdk/platform", + "//src/cdk/testing", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":a11y.md"], + name = "overview", + srcs = [":a11y.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/accordion/BUILD.bazel b/src/cdk/accordion/BUILD.bazel index a321f84c291..114e2a4ac35 100644 --- a/src/cdk/accordion/BUILD.bazel +++ b/src/cdk/accordion/BUILD.bazel @@ -1,41 +1,51 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ts_library", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "accordion", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/accordion", - deps = [ - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/coercion", - "//src/cdk/collections", - ] + name = "accordion", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/accordion", + deps = [ + "//src/cdk/coercion", + "//src/cdk/collections", + "@npm//@angular/core", + "@npm//rxjs", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - ":accordion", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":accordion", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [], + name = "overview", + srcs = [], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) - diff --git a/src/cdk/bidi/BUILD.bazel b/src/cdk/bidi/BUILD.bazel index c960b84f7a4..fdec0d0750e 100644 --- a/src/cdk/bidi/BUILD.bazel +++ b/src/cdk/bidi/BUILD.bazel @@ -1,38 +1,49 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "bidi", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/bidi", - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - ] + name = "bidi", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/bidi", + deps = [ + "@npm//@angular/common", + "@npm//@angular/core", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - ":bidi" - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":bidi", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":bidi.md"], + name = "overview", + srcs = [":bidi.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/coercion/BUILD.bazel b/src/cdk/coercion/BUILD.bazel index 2e5307f5b0f..648ad7d69bf 100644 --- a/src/cdk/coercion/BUILD.bazel +++ b/src/cdk/coercion/BUILD.bazel @@ -1,38 +1,44 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite", "markdown_to_html") +load("//tools:defaults.bzl", "markdown_to_html", "ts_library", "ts_web_test_suite") ts_library( - name = "coercion", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/coercion", - deps = [ - "@npm//@angular/core", - ] + name = "coercion", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/coercion", + deps = [ + "@npm//@angular/core", + ], ) ts_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/core", - "@npm//@types/jasmine", - ":coercion" - ], - testonly = 1, + name = "unit_test_sources", + testonly = 1, + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":coercion", + "@npm//@angular/core", + "@npm//@types/jasmine", + ], ) ts_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":coercion.md"], + name = "overview", + srcs = [":coercion.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/collections/BUILD.bazel b/src/cdk/collections/BUILD.bazel index 64f53e026c3..da6afe5e686 100644 --- a/src/cdk/collections/BUILD.bazel +++ b/src/cdk/collections/BUILD.bazel @@ -1,37 +1,48 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "collections", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/collections", - deps = [ - "@npm//@angular/core", - "@npm//rxjs", - ], + name = "collections", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/collections", + deps = [ + "@npm//@angular/core", + "@npm//rxjs", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - ":collections" - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":collections", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":collections.md"], + name = "overview", + srcs = [":collections.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/drag-drop/BUILD.bazel b/src/cdk/drag-drop/BUILD.bazel index 5197946c3a4..3945ed74391 100644 --- a/src/cdk/drag-drop/BUILD.bazel +++ b/src/cdk/drag-drop/BUILD.bazel @@ -1,46 +1,57 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "drag-drop", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/drag-drop", - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/platform", - "//src/cdk/scrolling", - "//src/cdk/bidi", - "//src/cdk/coercion", - ], + name = "drag-drop", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/drag-drop", + deps = [ + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/platform", + "//src/cdk/scrolling", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//rxjs", - "@npm//@angular/common", - "//src/cdk/testing", - "//src/cdk/bidi", - ":drag-drop", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":drag-drop", + "//src/cdk/bidi", + "//src/cdk/testing", + "@npm//@angular/common", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":drag-drop.md"], + name = "overview", + srcs = [":drag-drop.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/keycodes/BUILD.bazel b/src/cdk/keycodes/BUILD.bazel index cd63ee5aa52..22a40717f5f 100644 --- a/src/cdk/keycodes/BUILD.bazel +++ b/src/cdk/keycodes/BUILD.bazel @@ -1,35 +1,41 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite", "markdown_to_html") +load("//tools:defaults.bzl", "markdown_to_html", "ts_library", "ts_web_test_suite") ts_library( - name = "keycodes", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/keycodes", + name = "keycodes", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/keycodes", ) ts_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@types/jasmine", - "//src/cdk/testing", - ":keycodes" - ], - testonly = 1, + name = "unit_test_sources", + testonly = 1, + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":keycodes", + "//src/cdk/testing", + "@npm//@types/jasmine", + ], ) ts_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":keycodes.md"], + name = "overview", + srcs = [":keycodes.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/layout/BUILD.bazel b/src/cdk/layout/BUILD.bazel index ddeebe24efc..e7b6218b400 100644 --- a/src/cdk/layout/BUILD.bazel +++ b/src/cdk/layout/BUILD.bazel @@ -1,41 +1,52 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "layout", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/layout", - deps = [ - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/coercion", - "//src/cdk/platform", - ], + name = "layout", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/layout", + deps = [ + "//src/cdk/coercion", + "//src/cdk/platform", + "@npm//@angular/core", + "@npm//rxjs", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//rxjs", - "//src/cdk/platform", - ":layout", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":layout", + "//src/cdk/platform", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":layout.md"], + name = "overview", + srcs = [":layout.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/observers/BUILD.bazel b/src/cdk/observers/BUILD.bazel index 0664c28e804..bb21881626d 100644 --- a/src/cdk/observers/BUILD.bazel +++ b/src/cdk/observers/BUILD.bazel @@ -1,36 +1,47 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "observers", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/observers", - deps = [ - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/coercion", - ], + name = "observers", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/observers", + deps = [ + "//src/cdk/coercion", + "@npm//@angular/core", + "@npm//rxjs", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [":observers"], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [":observers"], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":observers.md"], + name = "overview", + srcs = [":observers.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/overlay/BUILD.bazel b/src/cdk/overlay/BUILD.bazel index f8dabd2b240..54bb06dd0b5 100644 --- a/src/cdk/overlay/BUILD.bazel +++ b/src/cdk/overlay/BUILD.bazel @@ -1,91 +1,103 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "overlay", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/overlay", - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/cdk/platform", - "//src/cdk/portal", - "//src/cdk/scrolling", - ], + name = "overlay", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/overlay", + deps = [ + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/cdk/platform", + "//src/cdk/portal", + "//src/cdk/scrolling", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "overlay_scss_lib", - srcs = glob(["**/_*.scss"]), + name = "overlay_scss_lib", + srcs = glob(["**/_*.scss"]), ) sass_binary( - name = "overlay_prebuilt_scss", - src = "overlay-prebuilt.scss", - deps = [":overlay_scss_lib"] + name = "overlay_prebuilt_scss", + src = "overlay-prebuilt.scss", + deps = [":overlay_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/platform", - "//src/cdk/portal", - "//src/cdk/scrolling", - "//src/cdk/testing", - ":overlay", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":overlay", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/platform", + "//src/cdk/portal", + "//src/cdk/scrolling", + "//src/cdk/testing", + "@npm//@angular/common", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], - static_css = ["overlay_prebuilt_scss"], + name = "unit_tests", + static_css = ["overlay_prebuilt_scss"], + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":overlay.md"], + name = "overview", + srcs = [":overlay.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/platform/BUILD.bazel b/src/cdk/platform/BUILD.bazel index d9efeb0c7e0..706d8e9bcce 100644 --- a/src/cdk/platform/BUILD.bazel +++ b/src/cdk/platform/BUILD.bazel @@ -1,23 +1,26 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "markdown_to_html") +load("//tools:defaults.bzl", "markdown_to_html", "ng_module") ng_module( - name = "platform", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/platform", - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - ] + name = "platform", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/platform", + deps = [ + "@npm//@angular/common", + "@npm//@angular/core", + ], ) markdown_to_html( - name = "overview", - srcs = [":platform.md"], + name = "overview", + srcs = [":platform.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/portal/BUILD.bazel b/src/cdk/portal/BUILD.bazel index 573d5250d2c..da5e035a54d 100644 --- a/src/cdk/portal/BUILD.bazel +++ b/src/cdk/portal/BUILD.bazel @@ -1,38 +1,48 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "portal", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/portal", - deps = [ - "@npm//@angular/core", - ], + name = "portal", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/portal", + deps = [ + "@npm//@angular/core", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/common", - ":portal", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":portal", + "@npm//@angular/common", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":portal.md"], + name = "overview", + srcs = [":portal.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) - diff --git a/src/cdk/schematics/BUILD.bazel b/src/cdk/schematics/BUILD.bazel index 38f217f0f52..411a1561997 100644 --- a/src/cdk/schematics/BUILD.bazel +++ b/src/cdk/schematics/BUILD.bazel @@ -5,74 +5,89 @@ load("//:packages.bzl", "VERSION_PLACEHOLDER_REPLACEMENTS") load("//tools:defaults.bzl", "jasmine_node_test", "ts_library") filegroup( - name = "schematics_assets", - srcs = glob(["**/files/**/*", "**/*.json"]), + name = "schematics_assets", + srcs = glob([ + "**/files/**/*", + "**/*.json", + ]), ) ts_library( - name = "schematics", - module_name = "@angular/cdk/schematics", - srcs = glob(["**/*.ts"], exclude=[ - "**/files/**/*.ts", - "**/*.spec.ts", - "ng-update/test-cases/**/*.ts", - "testing/**/*.ts" - ]), - tsconfig = ":tsconfig.json", - deps = [ - "@npm//@schematics/angular", - "@npm//@angular-devkit/core", - "@npm//@angular-devkit/schematics", - # TODO(devversion): Only include jasmine for test sources (See: tsconfig types). - "@npm//@types/jasmine", - "@npm//@types/node", - "@npm//glob", - "@npm//parse5", - "@npm//tslint", - "@npm//typescript", - "@npm//chalk" - ], + name = "schematics", + srcs = glob( + ["**/*.ts"], + exclude = [ + "**/files/**/*.ts", + "**/*.spec.ts", + "ng-update/test-cases/**/*.ts", + "testing/**/*.ts", + ], + ), + module_name = "@angular/cdk/schematics", + tsconfig = ":tsconfig.json", + deps = [ + "@npm//@schematics/angular", + "@npm//@angular-devkit/core", + "@npm//@angular-devkit/schematics", + # TODO(devversion): Only include jasmine for test sources (See: tsconfig types). + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//glob", + "@npm//parse5", + "@npm//tslint", + "@npm//typescript", + "@npm//chalk", + ], ) # This package is intended to be combined into the main @angular/cdk package as a dep. npm_package( - name = "npm_package", - srcs = [":schematics_assets"], - deps = [":schematics"], - replacements = VERSION_PLACEHOLDER_REPLACEMENTS, + name = "npm_package", + srcs = [":schematics_assets"], + replacements = VERSION_PLACEHOLDER_REPLACEMENTS, + deps = [":schematics"], ) ### Testing rules jasmine_node_test( - name = "unit_tests", - srcs = [":unit_test_sources"], - data = [":schematics_assets", ":schematics_test_cases"], + name = "unit_tests", + srcs = [":unit_test_sources"], + data = [ + ":schematics_assets", + ":schematics_test_cases", + ], ) ts_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts", "**/files/**/*.spec.ts"]), - deps = [ - "//src/cdk/schematics/testing", - "@npm//@schematics/angular", - "@npm//@angular-devkit/schematics", - "@npm//@types/jasmine", - "@npm//@types/node", - "@npm//mock-fs", - "@npm//tslint", - "@npm//typescript", - ":schematics", - ], - tsconfig = ":tsconfig.json", - testonly = True, + name = "unit_test_sources", + testonly = True, + srcs = glob( + ["**/*.spec.ts"], + exclude = [ + "**/*.e2e.spec.ts", + "**/files/**/*.spec.ts", + ], + ), + tsconfig = ":tsconfig.json", + deps = [ + ":schematics", + "//src/cdk/schematics/testing", + "@npm//@angular-devkit/schematics", + "@npm//@schematics/angular", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//mock-fs", + "@npm//tslint", + "@npm//typescript", + ], ) filegroup( - name = "schematics_test_cases", - srcs = glob([ - "ng-update/test-cases/**/*_input.ts", - "ng-update/test-cases/**/*_expected_output.ts" - ]), - testonly = True, + name = "schematics_test_cases", + testonly = True, + srcs = glob([ + "ng-update/test-cases/**/*_input.ts", + "ng-update/test-cases/**/*_expected_output.ts", + ]), ) diff --git a/src/cdk/schematics/testing/BUILD.bazel b/src/cdk/schematics/testing/BUILD.bazel index f02b87b0903..bbe6bc0d3a1 100644 --- a/src/cdk/schematics/testing/BUILD.bazel +++ b/src/cdk/schematics/testing/BUILD.bazel @@ -1,21 +1,21 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "jasmine_node_test", "ts_library") +load("//tools:defaults.bzl", "ts_library") ts_library( - name = "testing", - module_name = "@angular/cdk/schematics/testing", - srcs = glob(["**/*.ts"]), - tsconfig = "tsconfig.json", - deps = [ - "@npm//@angular-devkit/core", - "@npm//@angular-devkit/schematics", - "@npm//@schematics/angular", - "@npm//@types/node", - "@npm//@types/fs-extra", - "@npm//@types/jasmine", - "@npm//@types/glob", - "@npm//fs-extra", - "@npm//rxjs", - ], + name = "testing", + srcs = glob(["**/*.ts"]), + module_name = "@angular/cdk/schematics/testing", + tsconfig = "tsconfig.json", + deps = [ + "@npm//@angular-devkit/core", + "@npm//@angular-devkit/schematics", + "@npm//@schematics/angular", + "@npm//@types/fs-extra", + "@npm//@types/glob", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//fs-extra", + "@npm//rxjs", + ], ) diff --git a/src/cdk/scrolling/BUILD.bazel b/src/cdk/scrolling/BUILD.bazel index df96749f136..b999b974de4 100644 --- a/src/cdk/scrolling/BUILD.bazel +++ b/src/cdk/scrolling/BUILD.bazel @@ -1,53 +1,64 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "scrolling", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/scrolling", - assets = [":virtual-scroll-viewport.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/core", - "@npm//@angular/common", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/collections", - "//src/cdk/platform", - ], + name = "scrolling", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":virtual-scroll-viewport.css"] + glob(["**/*.html"]), + module_name = "@angular/cdk/scrolling", + deps = [ + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/collections", + "//src/cdk/platform", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_binary( - name = "virtual_scroll_viewport_scss", - src = "virtual-scroll-viewport.scss", + name = "virtual_scroll_viewport_scss", + src = "virtual-scroll-viewport.scss", ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/collections", - "//src/cdk/testing", - ":scrolling", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":scrolling", + "//src/cdk/bidi", + "//src/cdk/collections", + "//src/cdk/testing", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":scrolling.md"], + name = "overview", + srcs = [":scrolling.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/stepper/BUILD.bazel b/src/cdk/stepper/BUILD.bazel index 3981686fce1..8219972fa3f 100644 --- a/src/cdk/stepper/BUILD.bazel +++ b/src/cdk/stepper/BUILD.bazel @@ -1,29 +1,32 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "markdown_to_html") +load("//tools:defaults.bzl", "markdown_to_html", "ng_module") ng_module( - name = "stepper", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/stepper", - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - ], + name = "stepper", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/stepper", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//rxjs", + ], ) markdown_to_html( - name = "overview", - srcs = [":stepper.md"], + name = "overview", + srcs = [":stepper.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/table/BUILD.bazel b/src/cdk/table/BUILD.bazel index 00fd609e7e0..2550f71ff95 100644 --- a/src/cdk/table/BUILD.bazel +++ b/src/cdk/table/BUILD.bazel @@ -1,45 +1,56 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "table", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/table", - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/collections", - "//src/cdk/coercion", - "//src/cdk/platform", - ], + name = "table", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/table", + deps = [ + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/collections", + "//src/cdk/platform", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/collections", - ":table", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":table", + "//src/cdk/bidi", + "//src/cdk/collections", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":table.md"], + name = "overview", + srcs = [":table.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/testing/BUILD.bazel b/src/cdk/testing/BUILD.bazel index 6a9fb0d47c0..788b6f4a419 100644 --- a/src/cdk/testing/BUILD.bazel +++ b/src/cdk/testing/BUILD.bazel @@ -1,12 +1,15 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("//tools:defaults.bzl", "ng_module") ng_module( - name = "testing", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/testing", - deps = [ - "@npm//@angular/core", - ], + name = "testing", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/testing", + deps = [ + "@npm//@angular/core", + ], ) diff --git a/src/cdk/testing/e2e/BUILD.bazel b/src/cdk/testing/e2e/BUILD.bazel index 450808697ff..80d57ba4abd 100644 --- a/src/cdk/testing/e2e/BUILD.bazel +++ b/src/cdk/testing/e2e/BUILD.bazel @@ -1,11 +1,11 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("//tools:defaults.bzl", "ng_e2e_test_library") exports_files(["tsconfig-e2e.json"]) ng_e2e_test_library( - name = "e2e", - srcs = glob(["**/*.ts"]), - module_name = "@angular/cdk/testing/e2e" + name = "e2e", + srcs = glob(["**/*.ts"]), + module_name = "@angular/cdk/testing/e2e", ) diff --git a/src/cdk/text-field/BUILD.bazel b/src/cdk/text-field/BUILD.bazel index e950336d14d..d49909d1f4b 100644 --- a/src/cdk/text-field/BUILD.bazel +++ b/src/cdk/text-field/BUILD.bazel @@ -1,57 +1,68 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "text-field", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/text-field", - deps = [ - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/coercion", - "//src/cdk/platform", - ], + name = "text-field", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/text-field", + deps = [ + "//src/cdk/coercion", + "//src/cdk/platform", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "text_field_scss_lib", - srcs = glob(["**/_*.scss"]), + name = "text_field_scss_lib", + srcs = glob(["**/_*.scss"]), ) sass_binary( - name = "text_field_prebuilt_scss", - src = "text-field-prebuilt.scss", - deps = [":text_field_scss_lib"], + name = "text_field_prebuilt_scss", + src = "text-field-prebuilt.scss", + deps = [":text_field_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/platform", - "//src/cdk/testing", - ":text-field" - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":text-field", + "//src/cdk/platform", + "//src/cdk/testing", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], - static_css = [":text_field_prebuilt_scss"] + name = "unit_tests", + static_css = [":text_field_prebuilt_scss"], + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":text-field.md"], + name = "overview", + srcs = [":text-field.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/cdk/tree/BUILD.bazel b/src/cdk/tree/BUILD.bazel index 7cc8729310b..0f9d4ad6310 100644 --- a/src/cdk/tree/BUILD.bazel +++ b/src/cdk/tree/BUILD.bazel @@ -1,45 +1,56 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "tree", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/cdk/tree", - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/collections", - ], + name = "tree", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/cdk/tree", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/collections", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//rxjs", - "//src/cdk/collections", - "//src/cdk/bidi", - ":tree", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":tree", + "//src/cdk/bidi", + "//src/cdk/collections", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":tree.md"], + name = "overview", + srcs = [":tree.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/dev-app/BUILD.bazel b/src/dev-app/BUILD.bazel index 2e643450fc1..9bed24c900a 100644 --- a/src/dev-app/BUILD.bazel +++ b/src/dev-app/BUILD.bazel @@ -1,48 +1,64 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") -load("//:packages.bzl", "MATERIAL_TARGETS", "CDK_TARGETS", "CDK_EXPERIMENTAL_TARGETS", "MATERIAL_EXPERIMENTAL_TARGETS", "MATERIAL_EXPERIMENTAL_SCSS_LIBS") +load("//:packages.bzl", "CDK_EXPERIMENTAL_TARGETS", "CDK_TARGETS", "MATERIAL_EXPERIMENTAL_SCSS_LIBS", "MATERIAL_EXPERIMENTAL_TARGETS", "MATERIAL_TARGETS") load("//tools:defaults.bzl", "ng_module") load("//tools:sass_generate_binaries.bzl", "sass_generate_binaries") # Generate sass binaries for all nested SCSS files. -sass_generate_binaries("dev_app_scss", glob(["**/*.scss"], exclude = ["theme.scss"]), [ - # Needed for the input-demo sass file that uses CDK text-field mixins. - "//src/cdk/text-field:text_field_scss_lib" -]) +sass_generate_binaries( + "dev_app_scss", + glob( + ["**/*.scss"], + exclude = ["theme.scss"], + ), + [ + # Needed for the input-demo sass file that uses CDK text-field mixins. + "//src/cdk/text-field:text_field_scss_lib", + ], +) ng_module( - name = "dev-app", - srcs = glob(["**/*.ts"], exclude = ["system-config.ts", "system-rxjs-operators.ts"]), - assets = glob(["**/*.html"]) + [":dev_app_scss", ":theme"], - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/elements", - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//@angular/platform-browser-dynamic", - "@npm//@angular/router", - "@npm//rxjs", - "//src/material-experimental/mdc-button", - "//src/material-experimental/mdc-card", - "//src/material-experimental/mdc-checkbox", - "//src/material-experimental/mdc-chips", - "//src/material-experimental/mdc-menu", - "//src/material-experimental/mdc-radio", - "//src/material-experimental/mdc-slide-toggle", - "//src/material-examples:examples", - ] + CDK_TARGETS + CDK_EXPERIMENTAL_TARGETS + MATERIAL_TARGETS + MATERIAL_EXPERIMENTAL_TARGETS + name = "dev-app", + srcs = glob( + ["**/*.ts"], + exclude = [ + "system-config.ts", + "system-rxjs-operators.ts", + ], + ), + assets = glob(["**/*.html"]) + [ + ":dev_app_scss", + ":theme", + ], + deps = [ + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/elements", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//@angular/platform-browser-dynamic", + "@npm//@angular/router", + "@npm//rxjs", + "//src/material-experimental/mdc-button", + "//src/material-experimental/mdc-card", + "//src/material-experimental/mdc-checkbox", + "//src/material-experimental/mdc-chips", + "//src/material-experimental/mdc-menu", + "//src/material-experimental/mdc-radio", + "//src/material-experimental/mdc-slide-toggle", + "//src/material-examples:examples", + ] + CDK_TARGETS + CDK_EXPERIMENTAL_TARGETS + MATERIAL_TARGETS + MATERIAL_EXPERIMENTAL_TARGETS, ) sass_binary( - name = "theme", - src = "theme.scss", - include_paths = [ - "external/npm/node_modules", - ], - deps = [ - "//src/material/core:all_themes", - ] + MATERIAL_EXPERIMENTAL_SCSS_LIBS + name = "theme", + src = "theme.scss", + include_paths = [ + "external/npm/node_modules", + ], + deps = [ + "//src/material/core:all_themes", + ] + MATERIAL_EXPERIMENTAL_SCSS_LIBS, ) diff --git a/src/e2e-app/BUILD.bazel b/src/e2e-app/BUILD.bazel index 9662d67c70f..88b45bc1911 100644 --- a/src/e2e-app/BUILD.bazel +++ b/src/e2e-app/BUILD.bazel @@ -1,108 +1,119 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") -load("@npm_bazel_typescript//:defs.bzl", "ts_devserver", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_devserver") load("//tools:defaults.bzl", "ng_module") load("//:packages.bzl", "ANGULAR_LIBRARY_UMDS") -exports_files(["protractor.conf.js", "start-devserver.js"]) +exports_files([ + "protractor.conf.js", + "start-devserver.js", +]) ng_module( - name = "e2e-app", - srcs = glob(["**/*.ts"], exclude = ["test-util/**"]), - assets = glob(["**/*.html", "**/*.css"], exclude = ["index.html"]), - deps = [ - "@npm//@angular/core", - "@npm//@angular/elements", - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//@angular/router", - "@npm//@angular/animations", - "//src/cdk/drag-drop", - "//src/cdk/overlay", - "//src/cdk/scrolling", - "//src/material/button", - "//src/material/icon", - "//src/material/checkbox", - "//src/material/dialog", - "//src/material/core", - "//src/material/list", - "//src/material/grid-list", - "//src/material/icon", - "//src/material/form-field", - "//src/material/input", - "//src/material/menu", - "//src/material/progress-bar", - "//src/material/progress-spinner", - "//src/material/radio", - "//src/material/sidenav", - "//src/material/slide-toggle", - "//src/material/tabs", - "//src/material-examples:examples", - "//src/cdk-experimental/dialog", - "//src/cdk-experimental/scrolling", - "//src/material-experimental/mdc-button", - "//src/material-experimental/mdc-card", - "//src/material-experimental/mdc-checkbox", - "//src/material-experimental/mdc-chips", - "//src/material-experimental/mdc-menu", - "//src/material-experimental/mdc-radio", - "//src/material-experimental/mdc-slide-toggle", - ], + name = "e2e-app", + srcs = glob( + ["**/*.ts"], + exclude = ["test-util/**"], + ), + assets = glob( + [ + "**/*.html", + "**/*.css", + ], + exclude = ["index.html"], + ), + deps = [ + "//src/cdk-experimental/dialog", + "//src/cdk-experimental/scrolling", + "//src/cdk/drag-drop", + "//src/cdk/overlay", + "//src/cdk/scrolling", + "//src/material-examples:examples", + "//src/material-experimental/mdc-button", + "//src/material-experimental/mdc-card", + "//src/material-experimental/mdc-checkbox", + "//src/material-experimental/mdc-chips", + "//src/material-experimental/mdc-menu", + "//src/material-experimental/mdc-radio", + "//src/material-experimental/mdc-slide-toggle", + "//src/material/button", + "//src/material/checkbox", + "//src/material/core", + "//src/material/dialog", + "//src/material/form-field", + "//src/material/grid-list", + "//src/material/icon", + "//src/material/input", + "//src/material/list", + "//src/material/menu", + "//src/material/progress-bar", + "//src/material/progress-spinner", + "//src/material/radio", + "//src/material/sidenav", + "//src/material/slide-toggle", + "//src/material/tabs", + "@npm//@angular/animations", + "@npm//@angular/core", + "@npm//@angular/elements", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//@angular/router", + ], ) sass_binary( - name = "theme", - src = "theme.scss", - include_paths = [ - "external/npm/node_modules", - ], - deps = [ - "//src/material/core:all_themes", - "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", - "//src/material-experimental/mdc-button:mdc_button_scss_lib", - "//src/material-experimental/mdc-card:mdc_card_scss_lib", - "//src/material-experimental/mdc-checkbox:mdc_checkbox_scss_lib", - "//src/material-experimental/mdc-chips:mdc_chips_scss_lib", - "//src/material-experimental/mdc-menu:mdc_menu_scss_lib", - "//src/material-experimental/mdc-radio:mdc_radio_scss_lib", - "//src/material-experimental/mdc-slide-toggle:mdc_slide_toggle_scss_lib", - ] + name = "theme", + src = "theme.scss", + include_paths = [ + "external/npm/node_modules", + ], + deps = [ + "//src/material-experimental/mdc-button:mdc_button_scss_lib", + "//src/material-experimental/mdc-card:mdc_card_scss_lib", + "//src/material-experimental/mdc-checkbox:mdc_checkbox_scss_lib", + "//src/material-experimental/mdc-chips:mdc_chips_scss_lib", + "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material-experimental/mdc-menu:mdc_menu_scss_lib", + "//src/material-experimental/mdc-radio:mdc_radio_scss_lib", + "//src/material-experimental/mdc-slide-toggle:mdc_slide_toggle_scss_lib", + "//src/material/core:all_themes", + ], ) ts_devserver( name = "devserver", - port = 4200, - # Name of the AMD module that should be required on page load. - entry_module = "angular_material/src/e2e-app/main", - # Serving path of the bundle that serves all files specified in "deps" and "scripts". - serving_path = "/bundle.js", # Root paths can be used simplify the loading of files from external Bazel repositories # (such as the Bazel managed deps repository called "npm") additional_root_paths = [ - "npm/node_modules", - ], - # Files which should be provided by Bazel when running the devserver. These are not - # automatically served, but can be loaded manually through HTTP requests. - static_files = [ - "@npm//zone.js", - "@npm//core-js", - "@npm//hammerjs", - "@npm//material-components-web", - "@npm//moment", - "@npm//@webcomponents/custom-elements", - "//src/material/prebuilt-themes:indigo-pink", - ":index.html", - ":theme", + "npm/node_modules", ], + # Name of the AMD module that should be required on page load. + entry_module = "angular_material/src/e2e-app/main", + port = 4200, # Scripts which will be included in the serving_path bundle after "require.js" has been # loaded. # TODO(jelbourn): remove UMDs from here once we don't have to manually include them scripts = [ - ":devserver-configure.js", - "//tools/rxjs:rxjs_umd_modules", - "@npm//node_modules/tslib:tslib.js", + ":devserver-configure.js", + "//tools/rxjs:rxjs_umd_modules", + "@npm//node_modules/tslib:tslib.js", ] + ANGULAR_LIBRARY_UMDS, + # Serving path of the bundle that serves all files specified in "deps" and "scripts". + serving_path = "/bundle.js", + # Files which should be provided by Bazel when running the devserver. These are not + # automatically served, but can be loaded manually through HTTP requests. + static_files = [ + "@npm//zone.js", + "@npm//core-js", + "@npm//hammerjs", + "@npm//material-components-web", + "@npm//moment", + "@npm//@webcomponents/custom-elements", + "//src/material/prebuilt-themes:indigo-pink", + ":index.html", + ":theme", + ], # Dependencies that produce JavaScript output will be automatically included in the # serving_path bundle deps = [":e2e-app"], diff --git a/src/material-examples/BUILD.bazel b/src/material-examples/BUILD.bazel index 977d2fe8c23..30719e4bbfe 100644 --- a/src/material-examples/BUILD.bazel +++ b/src/material-examples/BUILD.bazel @@ -1,85 +1,95 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//:packages.bzl", "CDK_TARGETS", "CDK_EXPERIMENTAL_TARGETS", "MATERIAL_PACKAGES", "MATERIAL_EXPERIMENTAL_TARGETS", "ROLLUP_GLOBALS") +load("//:packages.bzl", "CDK_EXPERIMENTAL_TARGETS", "CDK_TARGETS", "MATERIAL_EXPERIMENTAL_TARGETS", "MATERIAL_PACKAGES", "ROLLUP_GLOBALS") load("//tools:defaults.bzl", "ng_module", "ng_package") load("//tools/highlight-files:index.bzl", "highlight_files") load("//tools/package-docs-content:index.bzl", "package_docs_content") ng_module( - name = "examples", - # TODO(paul): re-add the example-module genfile once angular/angular#30259 is resolved. - srcs = glob(["**/*.ts"]), - module_name = "@angular/material-examples", - assets = glob(["**/*.html", "**/*.css"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//moment", - "//src/material-moment-adapter", - ] + CDK_TARGETS + CDK_EXPERIMENTAL_TARGETS + MATERIAL_EXPERIMENTAL_TARGETS + ["//src/material/%s" % p for p in MATERIAL_PACKAGES], - # Specify the tsconfig that is also used by Gulp. We need to explicitly use this tsconfig - # because in order to import Moment with TypeScript, some specific options need to be set. - tsconfig = ":tsconfig-build.json", + name = "examples", + # TODO(paul): re-add the example-module genfile once angular/angular#30259 is resolved. + srcs = glob(["**/*.ts"]), + assets = glob([ + "**/*.html", + "**/*.css", + ]), + module_name = "@angular/material-examples", + # Specify the tsconfig that is also used by Gulp. We need to explicitly use this tsconfig + # because in order to import Moment with TypeScript, some specific options need to be set. + tsconfig = ":tsconfig-build.json", + deps = [ + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//moment", + "//src/material-moment-adapter", + ] + CDK_TARGETS + CDK_EXPERIMENTAL_TARGETS + MATERIAL_EXPERIMENTAL_TARGETS + ["//src/material/%s" % p for p in MATERIAL_PACKAGES], ) filegroup( - name = "example-source-files", - srcs = glob(["*/*.html", "*/*.css", "*/*.ts"]), + name = "example-source-files", + srcs = glob([ + "*/*.html", + "*/*.css", + "*/*.ts", + ]), ) highlight_files( - name = "highlighted-source-files", - srcs = [":example-source-files"], - tags = ["docs-package"], + name = "highlighted-source-files", + srcs = [":example-source-files"], + tags = ["docs-package"], ) package_docs_content( - name = "docs-content", - srcs = { - # We want to package the guides in to the docs content. These will be displayed - # in the documentation. - "//guides": "guides", + name = "docs-content", + srcs = { + # We want to package the guides in to the docs content. These will be displayed + # in the documentation. + "//guides": "guides", - # For the live-examples in our docs, we want to package the highlighted files - # into the docs content. These will be used to show the source code for examples. - ":highlighted-source-files": "examples-highlighted", + # For the live-examples in our docs, we want to package the highlighted files + # into the docs content. These will be used to show the source code for examples. + ":highlighted-source-files": "examples-highlighted", - # In order to be able to run examples in StackBlitz, we also want to package the - # plain source files into the docs-content. - ":example-source-files": "examples-source", + # In order to be able to run examples in StackBlitz, we also want to package the + # plain source files into the docs-content. + ":example-source-files": "examples-source", - # Package the overviews for "@angular/material" and "@angular/cdk" into the docs content - "//src/material:overviews": "overviews/material", - "//src/cdk:overviews": "overviews/cdk", + # Package the overviews for "@angular/material" and "@angular/cdk" into the docs content + "//src/material:overviews": "overviews/material", + "//src/cdk:overviews": "overviews/cdk", - # Package the API docs for the Material and CDK package into the docs-content - "//src:api-docs": "api-docs", - }, - tags = ["docs-package"], + # Package the API docs for the Material and CDK package into the docs-content + "//src:api-docs": "api-docs", + }, + tags = ["docs-package"], ) ng_package( - name = "npm_package", - srcs = ["package.json"], - entry_point = "src/material-examples/public_api.js", - globals = ROLLUP_GLOBALS, - deps = [":examples"], - data = [":docs-content"], - tags = ["docs-package"], + name = "npm_package", + srcs = ["package.json"], + data = [":docs-content"], + entry_point = "src/material-examples/public_api.js", + globals = ROLLUP_GLOBALS, + tags = ["docs-package"], + deps = [":examples"], ) genrule( - name = "example-module", - # In case the example-module.ts file is present as an actual source file (e.g. generated - # through Gulp), we need to exclude it because otherwise the genrule would fail. - # TODO(devversion): remove this once gulp has been replaced with bazel. - srcs = glob(["**/*.ts"], exclude = ["example-module.ts"]), - # TODO(devversion): we can't name the genrule output "example-module.ts" as it would - # get accidentally picked up when building the example module. See: angular/angular#30259 - outs = ["example-module_generated.ts"], - cmd = """ + name = "example-module", + # In case the example-module.ts file is present as an actual source file (e.g. generated + # through Gulp), we need to exclude it because otherwise the genrule would fail. + # TODO(devversion): remove this once gulp has been replaced with bazel. + srcs = glob( + ["**/*.ts"], + exclude = ["example-module.ts"], + ), + # TODO(devversion): we can't name the genrule output "example-module.ts" as it would + # get accidentally picked up when building the example module. See: angular/angular#30259 + outs = ["example-module_generated.ts"], + cmd = """ # As a workaround for https://github.com/bazelbuild/rules_nodejs/issues/404, we pass the # data to the Bazel entry-point through environment variables. export _SOURCE_FILES="$(SRCS)" @@ -89,7 +99,6 @@ genrule( # Run the bazel entry-point for generating the example module. ./$(location //tools/example-module:bazel-bin) """, - tools = ["//tools/example-module:bazel-bin"], - output_to_bindir = True, + output_to_bindir = True, + tools = ["//tools/example-module:bazel-bin"], ) - diff --git a/src/material-experimental/BUILD.bazel b/src/material-experimental/BUILD.bazel index 3c6db107d0d..8c5de77497c 100644 --- a/src/material-experimental/BUILD.bazel +++ b/src/material-experimental/BUILD.bazel @@ -1,26 +1,28 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library") load("//tools:defaults.bzl", "ng_module", "ng_package") load("//:packages.bzl", "ROLLUP_GLOBALS") exports_files(["mdc_require_config.js"]) ng_module( - name = "material-experimental", - srcs = glob(["*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-experimental", - deps = [ - "@npm//@angular/forms", - ], + name = "material-experimental", + srcs = glob( + ["*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/material-experimental", + deps = [ + "@npm//@angular/forms", + ], ) ng_package( - name = "npm_package", - srcs = ["package.json"], - entry_point = "src/material-experimental/public_api.js", - globals = ROLLUP_GLOBALS, - deps = [":material-experimental"], - # TODO(devversion): re-enable once we have set up the proper compiler for the ng_package - tags = ["manual"], + name = "npm_package", + srcs = ["package.json"], + entry_point = "src/material-experimental/public_api.js", + globals = ROLLUP_GLOBALS, + # TODO(devversion): re-enable once we have set up the proper compiler for the ng_package + tags = ["manual"], + deps = [":material-experimental"], ) diff --git a/src/material-experimental/mdc-button/BUILD.bazel b/src/material-experimental/mdc-button/BUILD.bazel index bf72312bc5d..98b7d410ca9 100644 --- a/src/material-experimental/mdc-button/BUILD.bazel +++ b/src/material-experimental/mdc-button/BUILD.bazel @@ -2,18 +2,25 @@ package(default_visibility = ["//visibility:public"]) load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_e2e_test_library") +load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module") ng_module( name = "mdc-button", - srcs = glob(["**/*.ts"], exclude = ["**/*.spec.ts"]), + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [ + ":button_scss", + ":fab_scss", + ":icon-button_scss", + ] + glob(["**/*.html"]), module_name = "@angular/material-experimental/mdc-button", - assets = [":button_scss", ":fab_scss", ":icon-button_scss"] + glob(["**/*.html"]), deps = [ - "@npm//@angular/animations", - "@npm//material-components-web", "//src/cdk/platform", "//src/material/core", + "@npm//@angular/animations", + "@npm//material-components-web", ], ) @@ -21,9 +28,9 @@ sass_library( name = "mdc_button_scss_lib", srcs = glob(["**/_*.scss"]), deps = [ - "//src/material/core:core_scss_lib", "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:core_scss_lib", ], ) @@ -34,9 +41,9 @@ sass_binary( "external/npm/node_modules", ], deps = [ - "//src/material/core:all_themes", "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:all_themes", ], ) @@ -47,9 +54,9 @@ sass_binary( "external/npm/node_modules", ], deps = [ - "//src/material/core:all_themes", "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:all_themes", ], ) @@ -60,32 +67,32 @@ sass_binary( "external/npm/node_modules", ], deps = [ - "//src/material/core:all_themes", "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:all_themes", ], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) diff --git a/src/material-experimental/mdc-card/BUILD.bazel b/src/material-experimental/mdc-card/BUILD.bazel index 77fc816fa3f..b9dbd33769a 100644 --- a/src/material-experimental/mdc-card/BUILD.bazel +++ b/src/material-experimental/mdc-card/BUILD.bazel @@ -1,54 +1,57 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_e2e_test_library") +load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module") ng_module( - name = "mdc-card", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-experimental/mdc-card", - assets = [":card_scss"] + glob(["**/*.html"]), - deps = [ - "@npm//material-components-web", - "//src/material/core", - ], + name = "mdc-card", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":card_scss"] + glob(["**/*.html"]), + module_name = "@angular/material-experimental/mdc-card", + deps = [ + "//src/material/core", + "@npm//material-components-web", + ], ) sass_library( - name = "mdc_card_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/material/core:core_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", - ], + name = "mdc_card_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "card_scss", - src = "card.scss", + name = "card_scss", + src = "card.scss", ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) diff --git a/src/material-experimental/mdc-checkbox/BUILD.bazel b/src/material-experimental/mdc-checkbox/BUILD.bazel index b36ae14b99c..679220dbdae 100644 --- a/src/material-experimental/mdc-checkbox/BUILD.bazel +++ b/src/material-experimental/mdc-checkbox/BUILD.bazel @@ -1,90 +1,96 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", "ng_e2e_test_library") +load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "ng_test_library", "ng_web_test_suite") ng_module( - name = "mdc-checkbox", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-experimental/mdc-checkbox", - assets = [":checkbox_scss"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//material-components-web", - "//src/cdk/coercion", - "//src/cdk/platform", - "//src/material/core", - "//src/material/checkbox", - ], + name = "mdc-checkbox", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":checkbox_scss"] + glob(["**/*.html"]), + module_name = "@angular/material-experimental/mdc-checkbox", + deps = [ + "//src/cdk/coercion", + "//src/cdk/platform", + "//src/material/checkbox", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//material-components-web", + ], ) sass_library( - name = "mdc_checkbox_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/material/core:core_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", - ], + name = "mdc_checkbox_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", + "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "checkbox_scss", - src = "checkbox.scss", - include_paths = [ - "external/npm/node_modules", - ], - deps = [ - "//src/material/core:all_themes", - "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", - ] + name = "checkbox_scss", + src = "checkbox.scss", + include_paths = [ + "external/npm/node_modules", + ], + deps = [ + "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", + "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:all_themes", + ], ) ng_test_library( - name = "checkbox_tests_lib", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - ":mdc-checkbox", - "@npm//@angular/platform-browser", - "@npm//@angular/forms", - "//src/cdk/testing", - ] + name = "checkbox_tests_lib", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":mdc-checkbox", + "//src/cdk/testing", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - static_files = ["@npm//node_modules/@material/checkbox:dist/mdc.checkbox.js"], - deps = [ - "//src/material-experimental:mdc_require_config.js", - ":checkbox_tests_lib", - ], + name = "unit_tests", + static_files = ["@npm//node_modules/@material/checkbox:dist/mdc.checkbox.js"], + deps = [ + ":checkbox_tests_lib", + "//src/material-experimental:mdc_require_config.js", + ], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) diff --git a/src/material-experimental/mdc-chips/BUILD.bazel b/src/material-experimental/mdc-chips/BUILD.bazel index c3cbfe03652..096e077509f 100644 --- a/src/material-experimental/mdc-chips/BUILD.bazel +++ b/src/material-experimental/mdc-chips/BUILD.bazel @@ -1,64 +1,67 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_e2e_test_library") +load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module") ng_module( - name = "mdc-chips", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-experimental/mdc-chips", - assets = [":chips_scss"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//material-components-web", - "//src/material/core", - ], + name = "mdc-chips", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":chips_scss"] + glob(["**/*.html"]), + module_name = "@angular/material-experimental/mdc-chips", + deps = [ + "//src/material/core", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//material-components-web", + ], ) sass_library( - name = "mdc_chips_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/material/core:core_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", - ], + name = "mdc_chips_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", + "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "chips_scss", - src = "chips.scss", - include_paths = [ - "external/npm/node_modules", - ], - deps = [ - "//src/material/core:all_themes", - "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", - ] + name = "chips_scss", + src = "chips.scss", + include_paths = [ + "external/npm/node_modules", + ], + deps = [ + "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:all_themes", + ], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) diff --git a/src/material-experimental/mdc-helpers/BUILD.bazel b/src/material-experimental/mdc-helpers/BUILD.bazel index f7c362e471b..4d573b982e2 100644 --- a/src/material-experimental/mdc-helpers/BUILD.bazel +++ b/src/material-experimental/mdc-helpers/BUILD.bazel @@ -1,16 +1,19 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("@io_bazel_rules_sass//:defs.bzl", "sass_library") load("//tools:defaults.bzl", "ng_module") ng_module( - name = "mdc-helpers", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-experimental/mdc-helpers", - assets = glob(["**/*.html"]), - deps = [ - "@npm//@angular/core", - ], + name = "mdc-helpers", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = glob(["**/*.html"]), + module_name = "@angular/material-experimental/mdc-helpers", + deps = [ + "@npm//@angular/core", + ], ) # Add all MDC Sass files that we depend on here. After updating MDC dependencies, use the following @@ -20,114 +23,114 @@ ng_module( # # TODO(mmalerba): Find a less tedious way to do this... sass_library( - name = "mdc_scss_deps_lib", - srcs = [ - "@npm//node_modules/@material/animation:_functions.scss", - "@npm//node_modules/@material/animation:_variables.scss", - "@npm//node_modules/@material/base:_mixins.scss", - "@npm//node_modules/@material/button:_mixins.scss", - "@npm//node_modules/@material/button:_variables.scss", - "@npm//node_modules/@material/card:_mixins.scss", - "@npm//node_modules/@material/card:_variables.scss", - "@npm//node_modules/@material/checkbox:_functions.scss", - "@npm//node_modules/@material/checkbox:_keyframes.scss", - "@npm//node_modules/@material/checkbox:_mixins.scss", - "@npm//node_modules/@material/checkbox:_variables.scss", - "@npm//node_modules/@material/chips:_mixins.scss", - "@npm//node_modules/@material/chips:_variables.scss", - "@npm//node_modules/@material/dialog:_mixins.scss", - "@npm//node_modules/@material/dialog:_variables.scss", - "@npm//node_modules/@material/drawer:_mixins.scss", - "@npm//node_modules/@material/drawer:_variables.scss", - "@npm//node_modules/@material/elevation:_mixins.scss", - "@npm//node_modules/@material/elevation:_variables.scss", - "@npm//node_modules/@material/fab:_mixins.scss", - "@npm//node_modules/@material/fab:_variables.scss", - "@npm//node_modules/@material/feature-targeting:_functions.scss", - "@npm//node_modules/@material/feature-targeting:_mixins.scss", - "@npm//node_modules/@material/feature-targeting:_variables.scss", - "@npm//node_modules/@material/floating-label:_mixins.scss", - "@npm//node_modules/@material/floating-label:_variables.scss", - "@npm//node_modules/@material/form-field:_mixins.scss", - "@npm//node_modules/@material/form-field:_variables.scss", - "@npm//node_modules/@material/grid-list:_mixins.scss", - "@npm//node_modules/@material/grid-list:_variables.scss", - "@npm//node_modules/@material/icon-button:_mixins.scss", - "@npm//node_modules/@material/icon-button:_variables.scss", - "@npm//node_modules/@material/image-list:_mixins.scss", - "@npm//node_modules/@material/image-list:_variables.scss", - "@npm//node_modules/@material/layout-grid:_mixins.scss", - "@npm//node_modules/@material/layout-grid:_variables.scss", - "@npm//node_modules/@material/linear-progress:_keyframes.scss", - "@npm//node_modules/@material/linear-progress:_mixins.scss", - "@npm//node_modules/@material/linear-progress:_variables.scss", - "@npm//node_modules/@material/line-ripple:_functions.scss", - "@npm//node_modules/@material/line-ripple:_mixins.scss", - "@npm//node_modules/@material/list:_mixins.scss", - "@npm//node_modules/@material/list:_variables.scss", - "@npm//node_modules/@material/menu:_mixins.scss", - "@npm//node_modules/@material/menu-surface:_mixins.scss", - "@npm//node_modules/@material/menu-surface:_variables.scss", - "@npm//node_modules/@material/menu:_variables.scss", - "@npm//node_modules/@material/notched-outline:_mixins.scss", - "@npm//node_modules/@material/notched-outline:_variables.scss", - "@npm//node_modules/@material/radio:_functions.scss", - "@npm//node_modules/@material/radio:_mixins.scss", - "@npm//node_modules/@material/radio:_variables.scss", - "@npm//node_modules/@material/ripple:_functions.scss", - "@npm//node_modules/@material/ripple:_keyframes.scss", - "@npm//node_modules/@material/ripple:_mixins.scss", - "@npm//node_modules/@material/ripple:_variables.scss", - "@npm//node_modules/@material/rtl:_mixins.scss", - "@npm//node_modules/@material/select:_functions.scss", - "@npm//node_modules/@material/select:helper-text/_mixins.scss", - "@npm//node_modules/@material/select:icon/_mixins.scss", - "@npm//node_modules/@material/select:icon/_variables.scss", - "@npm//node_modules/@material/select:_keyframes.scss", - "@npm//node_modules/@material/select:_mixins.scss", - "@npm//node_modules/@material/select:_variables.scss", - "@npm//node_modules/@material/shape:_functions.scss", - "@npm//node_modules/@material/shape:_mixins.scss", - "@npm//node_modules/@material/shape:_variables.scss", - "@npm//node_modules/@material/slider:_keyframes.scss", - "@npm//node_modules/@material/slider:_mixins.scss", - "@npm//node_modules/@material/slider:_variables.scss", - "@npm//node_modules/@material/snackbar:_mixins.scss", - "@npm//node_modules/@material/snackbar:_variables.scss", - "@npm//node_modules/@material/switch:_functions.scss", - "@npm//node_modules/@material/switch:_mixins.scss", - "@npm//node_modules/@material/switch:_variables.scss", - "@npm//node_modules/@material/tab-bar:_mixins.scss", - "@npm//node_modules/@material/tab-indicator:_mixins.scss", - "@npm//node_modules/@material/tab:_mixins.scss", - "@npm//node_modules/@material/tab:_variables.scss", - "@npm//node_modules/@material/textfield:character-counter/_mixins.scss", - "@npm//node_modules/@material/textfield:_functions.scss", - "@npm//node_modules/@material/textfield:helper-text/_mixins.scss", - "@npm//node_modules/@material/textfield:icon/_mixins.scss", - "@npm//node_modules/@material/textfield:icon/_variables.scss", - "@npm//node_modules/@material/textfield:_mixins.scss", - "@npm//node_modules/@material/textfield:_variables.scss", - "@npm//node_modules/@material/theme:_color-palette.scss", - "@npm//node_modules/@material/theme:_constants.scss", - "@npm//node_modules/@material/theme:_functions.scss", - "@npm//node_modules/@material/theme:_mixins.scss", - "@npm//node_modules/@material/theme:_variables.scss", - "@npm//node_modules/@material/toolbar:_mixins.scss", - "@npm//node_modules/@material/toolbar:_variables.scss", - "@npm//node_modules/@material/top-app-bar:_mixins.scss", - "@npm//node_modules/@material/top-app-bar:_variables.scss", - "@npm//node_modules/@material/typography:_functions.scss", - "@npm//node_modules/@material/typography:_mixins.scss", - "@npm//node_modules/@material/typography:_variables.scss", - ], + name = "mdc_scss_deps_lib", + srcs = [ + "@npm//node_modules/@material/animation:_functions.scss", + "@npm//node_modules/@material/animation:_variables.scss", + "@npm//node_modules/@material/base:_mixins.scss", + "@npm//node_modules/@material/button:_mixins.scss", + "@npm//node_modules/@material/button:_variables.scss", + "@npm//node_modules/@material/card:_mixins.scss", + "@npm//node_modules/@material/card:_variables.scss", + "@npm//node_modules/@material/checkbox:_functions.scss", + "@npm//node_modules/@material/checkbox:_keyframes.scss", + "@npm//node_modules/@material/checkbox:_mixins.scss", + "@npm//node_modules/@material/checkbox:_variables.scss", + "@npm//node_modules/@material/chips:_mixins.scss", + "@npm//node_modules/@material/chips:_variables.scss", + "@npm//node_modules/@material/dialog:_mixins.scss", + "@npm//node_modules/@material/dialog:_variables.scss", + "@npm//node_modules/@material/drawer:_mixins.scss", + "@npm//node_modules/@material/drawer:_variables.scss", + "@npm//node_modules/@material/elevation:_mixins.scss", + "@npm//node_modules/@material/elevation:_variables.scss", + "@npm//node_modules/@material/fab:_mixins.scss", + "@npm//node_modules/@material/fab:_variables.scss", + "@npm//node_modules/@material/feature-targeting:_functions.scss", + "@npm//node_modules/@material/feature-targeting:_mixins.scss", + "@npm//node_modules/@material/feature-targeting:_variables.scss", + "@npm//node_modules/@material/floating-label:_mixins.scss", + "@npm//node_modules/@material/floating-label:_variables.scss", + "@npm//node_modules/@material/form-field:_mixins.scss", + "@npm//node_modules/@material/form-field:_variables.scss", + "@npm//node_modules/@material/grid-list:_mixins.scss", + "@npm//node_modules/@material/grid-list:_variables.scss", + "@npm//node_modules/@material/icon-button:_mixins.scss", + "@npm//node_modules/@material/icon-button:_variables.scss", + "@npm//node_modules/@material/image-list:_mixins.scss", + "@npm//node_modules/@material/image-list:_variables.scss", + "@npm//node_modules/@material/layout-grid:_mixins.scss", + "@npm//node_modules/@material/layout-grid:_variables.scss", + "@npm//node_modules/@material/line-ripple:_functions.scss", + "@npm//node_modules/@material/line-ripple:_mixins.scss", + "@npm//node_modules/@material/linear-progress:_keyframes.scss", + "@npm//node_modules/@material/linear-progress:_mixins.scss", + "@npm//node_modules/@material/linear-progress:_variables.scss", + "@npm//node_modules/@material/list:_mixins.scss", + "@npm//node_modules/@material/list:_variables.scss", + "@npm//node_modules/@material/menu:_mixins.scss", + "@npm//node_modules/@material/menu:_variables.scss", + "@npm//node_modules/@material/menu-surface:_mixins.scss", + "@npm//node_modules/@material/menu-surface:_variables.scss", + "@npm//node_modules/@material/notched-outline:_mixins.scss", + "@npm//node_modules/@material/notched-outline:_variables.scss", + "@npm//node_modules/@material/radio:_functions.scss", + "@npm//node_modules/@material/radio:_mixins.scss", + "@npm//node_modules/@material/radio:_variables.scss", + "@npm//node_modules/@material/ripple:_functions.scss", + "@npm//node_modules/@material/ripple:_keyframes.scss", + "@npm//node_modules/@material/ripple:_mixins.scss", + "@npm//node_modules/@material/ripple:_variables.scss", + "@npm//node_modules/@material/rtl:_mixins.scss", + "@npm//node_modules/@material/select:_functions.scss", + "@npm//node_modules/@material/select:_keyframes.scss", + "@npm//node_modules/@material/select:_mixins.scss", + "@npm//node_modules/@material/select:_variables.scss", + "@npm//node_modules/@material/select:helper-text/_mixins.scss", + "@npm//node_modules/@material/select:icon/_mixins.scss", + "@npm//node_modules/@material/select:icon/_variables.scss", + "@npm//node_modules/@material/shape:_functions.scss", + "@npm//node_modules/@material/shape:_mixins.scss", + "@npm//node_modules/@material/shape:_variables.scss", + "@npm//node_modules/@material/slider:_keyframes.scss", + "@npm//node_modules/@material/slider:_mixins.scss", + "@npm//node_modules/@material/slider:_variables.scss", + "@npm//node_modules/@material/snackbar:_mixins.scss", + "@npm//node_modules/@material/snackbar:_variables.scss", + "@npm//node_modules/@material/switch:_functions.scss", + "@npm//node_modules/@material/switch:_mixins.scss", + "@npm//node_modules/@material/switch:_variables.scss", + "@npm//node_modules/@material/tab:_mixins.scss", + "@npm//node_modules/@material/tab:_variables.scss", + "@npm//node_modules/@material/tab-bar:_mixins.scss", + "@npm//node_modules/@material/tab-indicator:_mixins.scss", + "@npm//node_modules/@material/textfield:_functions.scss", + "@npm//node_modules/@material/textfield:_mixins.scss", + "@npm//node_modules/@material/textfield:_variables.scss", + "@npm//node_modules/@material/textfield:character-counter/_mixins.scss", + "@npm//node_modules/@material/textfield:helper-text/_mixins.scss", + "@npm//node_modules/@material/textfield:icon/_mixins.scss", + "@npm//node_modules/@material/textfield:icon/_variables.scss", + "@npm//node_modules/@material/theme:_color-palette.scss", + "@npm//node_modules/@material/theme:_constants.scss", + "@npm//node_modules/@material/theme:_functions.scss", + "@npm//node_modules/@material/theme:_mixins.scss", + "@npm//node_modules/@material/theme:_variables.scss", + "@npm//node_modules/@material/toolbar:_mixins.scss", + "@npm//node_modules/@material/toolbar:_variables.scss", + "@npm//node_modules/@material/top-app-bar:_mixins.scss", + "@npm//node_modules/@material/top-app-bar:_variables.scss", + "@npm//node_modules/@material/typography:_functions.scss", + "@npm//node_modules/@material/typography:_mixins.scss", + "@npm//node_modules/@material/typography:_variables.scss", + ], ) sass_library( - name = "mdc_helpers_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - ":mdc_scss_deps_lib", - "//src/material/core:core_scss_lib", - ], + name = "mdc_helpers_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + ":mdc_scss_deps_lib", + "//src/material/core:core_scss_lib", + ], ) diff --git a/src/material-experimental/mdc-menu/BUILD.bazel b/src/material-experimental/mdc-menu/BUILD.bazel index 4e20d4fc2d4..cabdbdf55b4 100644 --- a/src/material-experimental/mdc-menu/BUILD.bazel +++ b/src/material-experimental/mdc-menu/BUILD.bazel @@ -1,91 +1,97 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", "ng_e2e_test_library") +load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "ng_test_library", "ng_web_test_suite") ng_module( - name = "mdc-menu", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-experimental/mdc-menu", - assets = [":menu_scss"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//material-components-web", - "//src/cdk/overlay", - "//src/material/menu", - "//src/material/core", - ], + name = "mdc-menu", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":menu_scss"] + glob(["**/*.html"]), + module_name = "@angular/material-experimental/mdc-menu", + deps = [ + "//src/cdk/overlay", + "//src/material/core", + "//src/material/menu", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//material-components-web", + ], ) sass_library( - name = "mdc_menu_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/material/core:core_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", - ], + name = "mdc_menu_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", + "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "menu_scss", - src = "menu.scss", - include_paths = [ - "external/npm/node_modules", - ], - deps = [ - "//src/material/core:all_themes", - "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", - ] + name = "menu_scss", + src = "menu.scss", + include_paths = [ + "external/npm/node_modules", + ], + deps = [ + "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:all_themes", + ], ) ng_test_library( - name = "menu_tests_lib", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - ":mdc-menu", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/overlay", - "//src/cdk/keycodes", - "//src/cdk/scrolling", - "//src/cdk/testing", - "//src/material/core", - ] + name = "menu_tests_lib", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":mdc-menu", + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/scrolling", + "//src/cdk/testing", + "//src/material/core", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [ - ":menu_tests_lib", - ], + name = "unit_tests", + deps = [ + ":menu_tests_lib", + ], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) diff --git a/src/material-experimental/mdc-radio/BUILD.bazel b/src/material-experimental/mdc-radio/BUILD.bazel index 90d8f80b05b..a72d2d794fb 100644 --- a/src/material-experimental/mdc-radio/BUILD.bazel +++ b/src/material-experimental/mdc-radio/BUILD.bazel @@ -1,54 +1,57 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_e2e_test_library") +load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module") ng_module( - name = "mdc-radio", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-experimental/mdc-radio", - assets = [":radio_scss"] + glob(["**/*.html"]), - deps = [ - "@npm//material-components-web", - "//src/material/core", - ], + name = "mdc-radio", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":radio_scss"] + glob(["**/*.html"]), + module_name = "@angular/material-experimental/mdc-radio", + deps = [ + "//src/material/core", + "@npm//material-components-web", + ], ) sass_library( - name = "mdc_radio_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/material/core:core_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", - ], + name = "mdc_radio_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "radio_scss", - src = "radio.scss", + name = "radio_scss", + src = "radio.scss", ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) diff --git a/src/material-experimental/mdc-slide-toggle/BUILD.bazel b/src/material-experimental/mdc-slide-toggle/BUILD.bazel index ad574d24cfd..96199435bcb 100644 --- a/src/material-experimental/mdc-slide-toggle/BUILD.bazel +++ b/src/material-experimental/mdc-slide-toggle/BUILD.bazel @@ -1,88 +1,94 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", "ng_e2e_test_library") +load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "ng_test_library", "ng_web_test_suite") ng_module( - name = "mdc-slide-toggle", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-experimental/mdc-slide-toggle", - assets = [":slide_toggle_scss"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//@angular/animations", - "@npm//material-components-web", - "//src/cdk/coercion", - "//src/material/core", - ], + name = "mdc-slide-toggle", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":slide_toggle_scss"] + glob(["**/*.html"]), + module_name = "@angular/material-experimental/mdc-slide-toggle", + deps = [ + "//src/cdk/coercion", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//material-components-web", + ], ) sass_library( - name = "mdc_slide_toggle_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/material/core:core_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", - ], + name = "mdc_slide_toggle_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", + "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "slide_toggle_scss", - src = "slide-toggle.scss", - include_paths = [ - "external/npm/node_modules", - ], - deps = [ - "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", - "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", - ] + name = "slide_toggle_scss", + src = "slide-toggle.scss", + include_paths = [ + "external/npm/node_modules", + ], + deps = [ + "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib", + "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib", + ], ) ng_test_library( - name = "slide_toggle_tests_lib", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - ":mdc-slide-toggle", - "@npm//@angular/platform-browser", - "@npm//@angular/forms", - "//src/cdk/bidi", - "//src/cdk/testing", - ] + name = "slide_toggle_tests_lib", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":mdc-slide-toggle", + "//src/cdk/bidi", + "//src/cdk/testing", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - static_files = ["@npm//node_modules/@material/switch:dist/mdc.switch.js"], - deps = [ - "//src/material-experimental:mdc_require_config.js", - ":slide_toggle_tests_lib", - ], + name = "unit_tests", + static_files = ["@npm//node_modules/@material/switch:dist/mdc.switch.js"], + deps = [ + ":slide_toggle_tests_lib", + "//src/material-experimental:mdc_require_config.js", + ], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) diff --git a/src/material-experimental/popover-edit/BUILD.bazel b/src/material-experimental/popover-edit/BUILD.bazel index 329d5b0aeb0..6178095105c 100644 --- a/src/material-experimental/popover-edit/BUILD.bazel +++ b/src/material-experimental/popover-edit/BUILD.bazel @@ -1,45 +1,51 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("@io_bazel_rules_sass//:defs.bzl", "sass_library") load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite") ng_module( - name = "popover-edit", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-experimental/popover-edit", - deps = [ - "@npm//@angular/core", - "@npm//@angular/forms", - "//src/cdk-experimental/popover-edit", - ], + name = "popover-edit", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/material-experimental/popover-edit", + deps = [ + "//src/cdk-experimental/popover-edit", + "@npm//@angular/core", + "@npm//@angular/forms", + ], ) sass_library( - name = "popover_edit_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/material/core:core_scss_lib", - ], + name = "popover_edit_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - ":popover-edit", - "@npm//@angular/common", - "@npm//@angular/forms", - "@npm//rxjs", - "//src/cdk/collections", - "//src/cdk/keycodes", - "//src/cdk/testing", - "//src/cdk/overlay", - "//src/cdk-experimental/popover-edit", - "//src/material/table", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":popover-edit", + "//src/cdk-experimental/popover-edit", + "//src/cdk/collections", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/testing", + "//src/material/table", + "@npm//@angular/common", + "@npm//@angular/forms", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"] + name = "unit_tests", + deps = [":unit_test_sources"], ) diff --git a/src/material-moment-adapter/BUILD.bazel b/src/material-moment-adapter/BUILD.bazel index 94cb3d8f792..bd7e160ca54 100644 --- a/src/material-moment-adapter/BUILD.bazel +++ b/src/material-moment-adapter/BUILD.bazel @@ -1,53 +1,59 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module", "ng_package", "ng_web_test_suite", "ng_test_library") +load("//tools:defaults.bzl", "ng_module", "ng_package", "ng_test_library", "ng_web_test_suite") load("//:packages.bzl", "ROLLUP_GLOBALS") ng_module( - name = "material-moment-adapter", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material-moment-adapter", - deps = [ - "@npm//@angular/core", - "@npm//moment", - "//src/material/core", - ], - # Explicitly specify the tsconfig that is also used by Gulp. We need to explicitly use this - # tsconfig because in order to import Moment with TypeScript, we need some special options - # enabled. - tsconfig = ":tsconfig-build.json", + name = "material-moment-adapter", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/material-moment-adapter", + # Explicitly specify the tsconfig that is also used by Gulp. We need to explicitly use this + # tsconfig because in order to import Moment with TypeScript, we need some special options + # enabled. + tsconfig = ":tsconfig-build.json", + deps = [ + "//src/material/core", + "@npm//@angular/core", + "@npm//moment", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "//src/material/core", - "//src/material/testing", - "@npm//moment", - ":material-moment-adapter", - ], + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":material-moment-adapter", + "//src/material/core", + "//src/material/testing", + "@npm//moment", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [ - ":require-config.js", - ":unit_test_sources" - ], - # We need to load Moment statically since it is not a named AMD module and needs to - # be manually configured through "require.js" which is used by "ts_web_test_suite". - static_files = [ - "@npm//moment", - ], + name = "unit_tests", + # We need to load Moment statically since it is not a named AMD module and needs to + # be manually configured through "require.js" which is used by "ts_web_test_suite". + static_files = [ + "@npm//moment", + ], + deps = [ + ":require-config.js", + ":unit_test_sources", + ], ) ng_package( - name = "npm_package", - srcs = ["package.json"], - entry_point = "src/material-moment-adapter/public_api.js", - globals = ROLLUP_GLOBALS, - deps = [":material-moment-adapter"], - # TODO(devversion): re-enable once we have set up the proper compiler for the ng_package - tags = ["manual"], + name = "npm_package", + srcs = ["package.json"], + entry_point = "src/material-moment-adapter/public_api.js", + globals = ROLLUP_GLOBALS, + # TODO(devversion): re-enable once we have set up the proper compiler for the ng_package + tags = ["manual"], + deps = [":material-moment-adapter"], ) diff --git a/src/material/BUILD.bazel b/src/material/BUILD.bazel index e01d92918d2..d3a2df34b2b 100644 --- a/src/material/BUILD.bazel +++ b/src/material/BUILD.bazel @@ -1,55 +1,63 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("//tools:sass_bundle.bzl", "sass_bundle") load("//tools:defaults.bzl", "ng_module", "ng_package") -load("//:packages.bzl", "MATERIAL_PACKAGES", "MATERIAL_TARGETS", "MATERIAL_SCSS_LIBS", - "ROLLUP_GLOBALS") +load( + "//:packages.bzl", + "MATERIAL_PACKAGES", + "MATERIAL_SCSS_LIBS", + "MATERIAL_TARGETS", + "ROLLUP_GLOBALS", +) # Root "@angular/material" entry-point. ng_module( - name = "material", - srcs = glob(["*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material", - deps = ["//src/material/%s" % p for p in MATERIAL_PACKAGES] + [ - "@npm//@angular/forms", - "@npm//@angular/animations", - ], + name = "material", + srcs = glob( + ["*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/material", + deps = ["//src/material/%s" % p for p in MATERIAL_PACKAGES] + [ + "@npm//@angular/forms", + "@npm//@angular/animations", + ], ) sass_bundle( - name = "theming_bundle", - srcs = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/cdk/overlay:overlay_scss_lib", - "//src/cdk/text-field:text_field_scss_lib", - ] + MATERIAL_SCSS_LIBS, - entry_point = '//src/material/core:theming/_all-theme.scss', - output_name = "_theming.scss", + name = "theming_bundle", + srcs = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/cdk/overlay:overlay_scss_lib", + "//src/cdk/text-field:text_field_scss_lib", + ] + MATERIAL_SCSS_LIBS, + entry_point = "//src/material/core:theming/_all-theme.scss", + output_name = "_theming.scss", ) filegroup( - name = "overviews", - srcs = ["//src/material/%s:overview" % name for name in MATERIAL_PACKAGES] + name = "overviews", + srcs = ["//src/material/%s:overview" % name for name in MATERIAL_PACKAGES], ) # Creates the @angular/material package published to npm. ng_package( - name = "npm_package", - srcs = ["package.json"], - entry_point = "src/material/public_api.js", - entry_point_name = "material", - globals = ROLLUP_GLOBALS, - data = [ - ":theming_bundle", - "//src/material/prebuilt-themes:indigo-pink", - "//src/material/prebuilt-themes:deeppurple-amber", - "//src/material/prebuilt-themes:pink-bluegrey", - "//src/material/prebuilt-themes:purple-green", - ], - packages = ["//src/material/schematics:npm_package"], - deps = MATERIAL_TARGETS, - # TODO(devversion): Use the npm package for publishing. Right now this is disabled because - # we build using AOT for serving & testing, but the `ng_package` rule should not include factory - # files. - tags = ["manual"], + name = "npm_package", + srcs = ["package.json"], + data = [ + ":theming_bundle", + "//src/material/prebuilt-themes:deeppurple-amber", + "//src/material/prebuilt-themes:indigo-pink", + "//src/material/prebuilt-themes:pink-bluegrey", + "//src/material/prebuilt-themes:purple-green", + ], + entry_point = "src/material/public_api.js", + entry_point_name = "material", + globals = ROLLUP_GLOBALS, + packages = ["//src/material/schematics:npm_package"], + # TODO(devversion): Use the npm package for publishing. Right now this is disabled because + # we build using AOT for serving & testing, but the `ng_package` rule should not include factory + # files. + tags = ["manual"], + deps = MATERIAL_TARGETS, ) diff --git a/src/material/autocomplete/BUILD.bazel b/src/material/autocomplete/BUILD.bazel index 04234e4ae55..f6d1a5b81f7 100644 --- a/src/material/autocomplete/BUILD.bazel +++ b/src/material/autocomplete/BUILD.bazel @@ -1,76 +1,87 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "autocomplete", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/autocomplete", - assets = [":autocomplete.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/portal", - "//src/cdk/scrolling", - "//src/material/core", - "//src/material/form-field", - ] + name = "autocomplete", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":autocomplete.css"] + glob(["**/*.html"]), + module_name = "@angular/material/autocomplete", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/portal", + "//src/cdk/scrolling", + "//src/material/core", + "//src/material/form-field", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//rxjs", + ], ) sass_library( - name = "autocomplete_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "autocomplete_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "autocomplete_scss", - src = "autocomplete.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "autocomplete_scss", + src = "autocomplete.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/scrolling", - "//src/cdk/testing", - "//src/material/core", - "//src/material/form-field", - "//src/material/input", - ":autocomplete" - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":autocomplete", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/scrolling", + "//src/cdk/testing", + "//src/material/core", + "//src/material/form-field", + "//src/material/input", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":autocomplete.md"], + name = "overview", + srcs = [":autocomplete.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/badge/BUILD.bazel b/src/material/badge/BUILD.bazel index 54a4bfa8c3d..76364596ee2 100644 --- a/src/material/badge/BUILD.bazel +++ b/src/material/badge/BUILD.bazel @@ -1,54 +1,65 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "badge", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/badge", - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/platform-browser", - "@npm//@angular/animations", - "//src/cdk/a11y", - "//src/cdk/coercion", - "//src/material/core", - ] + glob(["**/*.html"]), + name = "badge", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + module_name = "@angular/material/badge", + deps = [ + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/platform-browser", + "@npm//@angular/animations", + "//src/cdk/a11y", + "//src/cdk/coercion", + "//src/material/core", + ] + glob(["**/*.html"]), ) sass_library( - name = "badge_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ] + name = "badge_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "//src/material/core", - ":badge", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":badge", + "//src/material/core", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":badge.md"], + name = "overview", + srcs = [":badge.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/bottom-sheet/BUILD.bazel b/src/material/bottom-sheet/BUILD.bazel index 397043d1f11..46d9d427cb2 100644 --- a/src/material/bottom-sheet/BUILD.bazel +++ b/src/material/bottom-sheet/BUILD.bazel @@ -1,69 +1,80 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "bottom-sheet", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/bottom-sheet", - assets = [ - ":bottom-sheet-container.css", - ] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/layout", - "//src/cdk/portal", - "//src/material/core", - ], + name = "bottom-sheet", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [ + ":bottom-sheet-container.css", + ] + glob(["**/*.html"]), + module_name = "@angular/material/bottom-sheet", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/layout", + "//src/cdk/overlay", + "//src/cdk/portal", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "bottom_sheet_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "bottom_sheet_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "bottom_sheet_container_scss", - src = "bottom-sheet-container.scss", - deps = ["//src/cdk/a11y:a11y_scss_lib"], + name = "bottom_sheet_container_scss", + src = "bottom-sheet-container.scss", + deps = ["//src/cdk/a11y:a11y_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/platform-browser", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/scrolling", - "//src/cdk/testing", - ":bottom-sheet", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":bottom-sheet", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/scrolling", + "//src/cdk/testing", + "@npm//@angular/common", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":bottom-sheet.md"], + name = "overview", + srcs = [":bottom-sheet.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/button-toggle/BUILD.bazel b/src/material/button-toggle/BUILD.bazel index 1cbd25410f4..ebce74010c5 100644 --- a/src/material/button-toggle/BUILD.bazel +++ b/src/material/button-toggle/BUILD.bazel @@ -1,86 +1,98 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "button-toggle", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/button-toggle", - assets = [":button-toggle.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/core", - "@npm//@angular/forms", - "//src/cdk/collections", - "//src/cdk/coercion", - "//src/cdk/a11y", - "//src/material/core", - ], + name = "button-toggle", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":button-toggle.css"] + glob(["**/*.html"]), + module_name = "@angular/material/button-toggle", + deps = [ + "//src/cdk/a11y", + "//src/cdk/coercion", + "//src/cdk/collections", + "//src/material/core", + "@npm//@angular/core", + "@npm//@angular/forms", + ], ) sass_library( - name = "button_toggle_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"] + name = "button_toggle_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "button_toggle_scss", - src = "button-toggle.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "button_toggle_scss", + src = "button-toggle.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "//src/cdk/testing", - ":button-toggle", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":button-toggle", + "//src/cdk/testing", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":button-toggle.md"], + name = "overview", + srcs = [":button-toggle.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/button/BUILD.bazel b/src/material/button/BUILD.bazel index 4b41cae455b..1db49ab3790 100644 --- a/src/material/button/BUILD.bazel +++ b/src/material/button/BUILD.bazel @@ -1,86 +1,98 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "button", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/button", - assets = [":button.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/platform-browser", - "@npm//@angular/animations", - "//src/cdk/a11y", - "//src/material/core", - ], + name = "button", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":button.css"] + glob(["**/*.html"]), + module_name = "@angular/material/button", + deps = [ + "//src/cdk/a11y", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/platform-browser", + ], ) sass_library( - name = "button_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "button_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "button_scss", - src = "button.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ":button_scss_lib" - ], + name = "button_scss", + src = "button.scss", + deps = [ + ":button_scss_lib", + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "//src/material/core", - ":button" - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":button", + "//src/material/core", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":button.md"], + name = "overview", + srcs = [":button.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/card/BUILD.bazel b/src/material/card/BUILD.bazel index c7d7f6efa80..e3253c5ae17 100644 --- a/src/material/card/BUILD.bazel +++ b/src/material/card/BUILD.bazel @@ -1,65 +1,68 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "markdown_to_html", "ng_e2e_test_library") +load("//tools:defaults.bzl", "markdown_to_html", "ng_e2e_test_library", "ng_module") ng_module( - name = "card", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/card", - assets = [":card.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/core", - "//src/material/core", - ], + name = "card", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":card.css"] + glob(["**/*.html"]), + module_name = "@angular/material/card", + deps = [ + "//src/material/core", + "@npm//@angular/core", + ], ) sass_library( - name = "card_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "card_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "card_scss", - src = "card.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "card_scss", + src = "card.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":card.md"], + name = "overview", + srcs = [":card.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/checkbox/BUILD.bazel b/src/material/checkbox/BUILD.bazel index fbe36a71850..865abbb5253 100644 --- a/src/material/checkbox/BUILD.bazel +++ b/src/material/checkbox/BUILD.bazel @@ -1,93 +1,105 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "checkbox", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/checkbox", - assets = [":checkbox.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//@angular/animations", - "//src/cdk/a11y", - "//src/cdk/coercion", - "//src/cdk/observers", - "//src/material/core", - ], + name = "checkbox", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":checkbox.css"] + glob(["**/*.html"]), + module_name = "@angular/material/checkbox", + deps = [ + "//src/cdk/a11y", + "//src/cdk/coercion", + "//src/cdk/observers", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) sass_library( - name = "checkbox_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ] + name = "checkbox_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "checkbox_scss", - src = "checkbox.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "checkbox_scss", + src = "checkbox.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "//src/cdk/observers", - "//src/cdk/testing", - ":checkbox", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":checkbox", + "//src/cdk/observers", + "//src/cdk/testing", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":checkbox.md"], + name = "overview", + srcs = [":checkbox.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/chips/BUILD.bazel b/src/material/chips/BUILD.bazel index f3d7c760040..9a40c463752 100644 --- a/src/material/chips/BUILD.bazel +++ b/src/material/chips/BUILD.bazel @@ -1,75 +1,86 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "chips", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/chips", - assets = [":chips.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/collections", - "//src/cdk/keycodes", - "//src/cdk/platform", - "//src/material/core", - "//src/material/form-field", - ], + name = "chips", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":chips.css"] + glob(["**/*.html"]), + module_name = "@angular/material/chips", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/collections", + "//src/cdk/keycodes", + "//src/cdk/platform", + "//src/material/core", + "//src/material/form-field", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//rxjs", + ], ) sass_library( - name = "chips_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "chips_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "chips_scss", - src = "chips.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "chips_scss", + src = "chips.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/material/core", - "//src/cdk/keycodes", - "//src/cdk/platform", - "//src/cdk/testing", - "//src/material/form-field", - "//src/material/input", - ":chips", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":chips", + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/platform", + "//src/cdk/testing", + "//src/material/core", + "//src/material/form-field", + "//src/material/input", + "@npm//@angular/animations", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":chips.md"], + name = "overview", + srcs = [":chips.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/core/BUILD.bazel b/src/material/core/BUILD.bazel index 4203b9a4f6b..1f807efa74f 100644 --- a/src/material/core/BUILD.bazel +++ b/src/material/core/BUILD.bazel @@ -1,134 +1,147 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("//:packages.bzl", "MATERIAL_SCSS_LIBS") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) exports_files(["theming/_theming.scss"]) ng_module( - name = "core", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/core", - assets = [ - ":selection/pseudo-checkbox/pseudo-checkbox.css", - ":option/option.css", - ":option/optgroup.css", - ] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/cdk/platform", - ], + name = "core", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [ + ":selection/pseudo-checkbox/pseudo-checkbox.css", + ":option/option.css", + ":option/optgroup.css", + ] + glob(["**/*.html"]), + module_name = "@angular/material/core", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/cdk/platform", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) sass_library( - name = "core_scss_lib", - srcs = glob(["**/_*.scss"], exclude = ["theming/_all-theme.scss"]), - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/cdk/overlay:overlay_scss_lib", - "//src/cdk/text-field:text_field_scss_lib", - ], + name = "core_scss_lib", + srcs = glob( + ["**/_*.scss"], + exclude = ["theming/_all-theme.scss"], + ), + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/cdk/overlay:overlay_scss_lib", + "//src/cdk/text-field:text_field_scss_lib", + ], ) sass_binary( - name = "pseudo_checkbox_scss", - src = "selection/pseudo-checkbox/pseudo-checkbox.scss", - deps = [":core_scss_lib"], + name = "pseudo_checkbox_scss", + src = "selection/pseudo-checkbox/pseudo-checkbox.scss", + deps = [":core_scss_lib"], ) sass_binary( - name = "option_scss", - src = "option/option.scss", - deps = [":core_scss_lib"], + name = "option_scss", + src = "option/option.scss", + deps = [":core_scss_lib"], ) sass_binary( - name = "optgroup_scss", - src = "option/optgroup.scss", - deps = [":core_scss_lib"], + name = "optgroup_scss", + src = "option/optgroup.scss", + deps = [":core_scss_lib"], ) sass_library( - name = "all_themes", - srcs = [ - "theming/_all-theme.scss", - "typography/_all-typography.scss", - ], - deps = MATERIAL_SCSS_LIBS, + name = "all_themes", + srcs = [ + "theming/_all-theme.scss", + "typography/_all-typography.scss", + ], + deps = MATERIAL_SCSS_LIBS, ) sass_binary( - name = "indigo_pink_prebuilt", - src = "theming/prebuilt/indigo-pink.scss", - deps = [":all_themes"], + name = "indigo_pink_prebuilt", + src = "theming/prebuilt/indigo-pink.scss", + deps = [":all_themes"], ) sass_binary( - name = "deeppurple-amber_prebuilt", - src = "theming/prebuilt/deeppurple-amber.scss", - deps = [":all_themes"], + name = "deeppurple-amber_prebuilt", + src = "theming/prebuilt/deeppurple-amber.scss", + deps = [":all_themes"], ) sass_binary( - name = "pink-bluegrey_prebuilt", - src = "theming/prebuilt/pink-bluegrey.scss", - deps = [":all_themes"], + name = "pink-bluegrey_prebuilt", + src = "theming/prebuilt/pink-bluegrey.scss", + deps = [":all_themes"], ) sass_binary( - name = "purple-green_prebuilt", - src = "theming/prebuilt/purple-green.scss", - deps = [":all_themes"], + name = "purple-green_prebuilt", + src = "theming/prebuilt/purple-green.scss", + deps = [":all_themes"], ) - ################# # Test targets ################# ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "//src/cdk/keycodes", - "//src/cdk/platform", - "//src/cdk/testing", - "//src/material/testing", - ":core", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":core", + "//src/cdk/keycodes", + "//src/cdk/platform", + "//src/cdk/testing", + "//src/material/testing", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = ["ripple/ripple.md"], + name = "overview", + srcs = ["ripple/ripple.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) # Test theme used to ensure that our themes will compile using CSS variables in the palettes. sass_binary( - name = "test-css-variables-theme", - src = "theming/test-css-variables-theme.scss", - deps = [":all_themes"], - testonly = True + name = "test-css-variables-theme", + testonly = True, + src = "theming/test-css-variables-theme.scss", + deps = [":all_themes"], ) diff --git a/src/material/datepicker/BUILD.bazel b/src/material/datepicker/BUILD.bazel index bb99635165e..b90de635c53 100644 --- a/src/material/datepicker/BUILD.bazel +++ b/src/material/datepicker/BUILD.bazel @@ -1,99 +1,110 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "datepicker", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/datepicker", - assets = [ - ":datepicker-content.css", - ":datepicker-toggle.css", - ":calendar-body.css", - ":calendar.css", - ] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/portal", - "//src/material/button", - "//src/material/core", - "//src/material/dialog", - "//src/material/form-field", - "//src/material/input", - ], + name = "datepicker", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [ + ":datepicker-content.css", + ":datepicker-toggle.css", + ":calendar-body.css", + ":calendar.css", + ] + glob(["**/*.html"]), + module_name = "@angular/material/datepicker", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/portal", + "//src/material/button", + "//src/material/core", + "//src/material/dialog", + "//src/material/form-field", + "//src/material/input", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//rxjs", + ], ) sass_library( - name = "datepicker_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "datepicker_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "datepicker_content_scss", - src = "datepicker-content.scss", + name = "datepicker_content_scss", + src = "datepicker-content.scss", ) sass_binary( - name = "datepicker_toggle_scss", - src = "datepicker-toggle.scss", + name = "datepicker_toggle_scss", + src = "datepicker-toggle.scss", ) sass_binary( - name = "calendar_scss", - src = "calendar.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "calendar_scss", + src = "calendar.scss", + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "calendar_body_scss", - src = "calendar-body.scss", - deps = ["//src/cdk/a11y:a11y_scss_lib"], + name = "calendar_body_scss", + src = "calendar-body.scss", + deps = ["//src/cdk/a11y:a11y_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//@angular/platform-browser-dynamic", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/scrolling", - "//src/cdk/testing", - "//src/material/core", - "//src/material/form-field", - "//src/material/input", - "//src/material/testing", - ":datepicker", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":datepicker", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/scrolling", + "//src/cdk/testing", + "//src/material/core", + "//src/material/form-field", + "//src/material/input", + "//src/material/testing", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//@angular/platform-browser-dynamic", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":datepicker.md"], + name = "overview", + srcs = [":datepicker.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/dialog/BUILD.bazel b/src/material/dialog/BUILD.bazel index dde2efaf3b6..e1d1ee67cc0 100644 --- a/src/material/dialog/BUILD.bazel +++ b/src/material/dialog/BUILD.bazel @@ -1,95 +1,107 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "dialog", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/dialog", - assets = [":dialog.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/portal", - "//src/material/core", - ], + name = "dialog", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":dialog.css"] + glob(["**/*.html"]), + module_name = "@angular/material/dialog", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/portal", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "dialog_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "dialog_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "dialog_scss", - src = "dialog.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "dialog_scss", + src = "dialog.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/scrolling", - "//src/cdk/testing", - ":dialog", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":dialog", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/scrolling", + "//src/cdk/testing", + "@npm//@angular/common", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":dialog.md"], + name = "overview", + srcs = [":dialog.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/divider/BUILD.bazel b/src/material/divider/BUILD.bazel index 5ecc6f744c1..644ffb242ed 100644 --- a/src/material/divider/BUILD.bazel +++ b/src/material/divider/BUILD.bazel @@ -1,53 +1,64 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "divider", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/divider", - assets = [":divider.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "//src/cdk/coercion", - "//src/material/core", - ], + name = "divider", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":divider.css"] + glob(["**/*.html"]), + module_name = "@angular/material/divider", + deps = [ + "//src/cdk/coercion", + "//src/material/core", + "@npm//@angular/common", + "@npm//@angular/core", + ], ) sass_library( - name = "divider_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "divider_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "divider_scss", - src = "divider.scss", + name = "divider_scss", + src = "divider.scss", ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - ":divider", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":divider", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":divider.md"], + name = "overview", + srcs = [":divider.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/expansion/BUILD.bazel b/src/material/expansion/BUILD.bazel index b9f6dd55f3c..539417c0adc 100644 --- a/src/material/expansion/BUILD.bazel +++ b/src/material/expansion/BUILD.bazel @@ -1,100 +1,112 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "expansion", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/expansion", - assets = glob(["**/*.html"]) + [ - ":expansion-panel.css", - ":expansion-panel-header.css", - ], - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/accordion", - "//src/cdk/coercion", - "//src/cdk/collections", - "//src/cdk/keycodes", - "//src/cdk/portal", - ], + name = "expansion", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = glob(["**/*.html"]) + [ + ":expansion-panel.css", + ":expansion-panel-header.css", + ], + module_name = "@angular/material/expansion", + deps = [ + "//src/cdk/a11y", + "//src/cdk/accordion", + "//src/cdk/coercion", + "//src/cdk/collections", + "//src/cdk/keycodes", + "//src/cdk/portal", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) sass_library( - name = "expansion_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "expansion_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "expansion_panel_scss", - src = "expansion-panel.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "expansion_panel_scss", + src = "expansion-panel.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "expansion_panel_header_scss", - src = "expansion-panel-header.scss", + name = "expansion_panel_header_scss", + src = "expansion-panel-header.scss", ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "//src/cdk/a11y", - "//src/cdk/keycodes", - "//src/cdk/testing", - ":expansion", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":expansion", + "//src/cdk/a11y", + "//src/cdk/keycodes", + "//src/cdk/testing", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":expansion.md"], + name = "overview", + srcs = [":expansion.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/form-field/BUILD.bazel b/src/material/form-field/BUILD.bazel index 35dc9e29322..d68d503a086 100644 --- a/src/material/form-field/BUILD.bazel +++ b/src/material/form-field/BUILD.bazel @@ -1,95 +1,98 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load("//tools:defaults.bzl", "markdown_to_html", "ng_module") ng_module( - name = "form-field", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/form-field", - assets = [ - ":form-field.css", - ":form-field-fill.css", - ":form-field-input.css", - ":form-field-legacy.css", - ":form-field-outline.css", - ":form-field-standard.css", - ] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/observers", - "//src/cdk/platform", - "//src/material/core", - ], + name = "form-field", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [ + ":form-field.css", + ":form-field-fill.css", + ":form-field-input.css", + ":form-field-legacy.css", + ":form-field-outline.css", + ":form-field-standard.css", + ] + glob(["**/*.html"]), + module_name = "@angular/material/form-field", + deps = [ + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/observers", + "//src/cdk/platform", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) sass_library( - name = "form_field_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "form_field_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "form_field_scss", - src = "form-field.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "form_field_scss", + src = "form-field.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "form_field_fill_scss", - src = "form-field-fill.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "form_field_fill_scss", + src = "form-field-fill.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "form_field_input_scss", - src = "form-field-input.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "form_field_input_scss", + src = "form-field-input.scss", + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "form_field_legacy_scss", - src = "form-field-legacy.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "form_field_legacy_scss", + src = "form-field-legacy.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "form_field_outline_scss", - src = "form-field-outline.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "form_field_outline_scss", + src = "form-field-outline.scss", + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "form_field_standard_scss", - src = "form-field-standard.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "form_field_standard_scss", + src = "form-field-standard.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) markdown_to_html( - name = "overview", - srcs = [":form-field.md"], + name = "overview", + srcs = [":form-field.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/grid-list/BUILD.bazel b/src/material/grid-list/BUILD.bazel index a29c8c6ccb8..2b9eee92b87 100644 --- a/src/material/grid-list/BUILD.bazel +++ b/src/material/grid-list/BUILD.bazel @@ -1,80 +1,92 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "grid-list", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/grid-list", - assets = [":grid-list.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/core", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/material/core", - ], + name = "grid-list", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":grid-list.css"] + glob(["**/*.html"]), + module_name = "@angular/material/grid-list", + deps = [ + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/material/core", + "@npm//@angular/core", + ], ) sass_library( - name = "grid_list_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "grid_list_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "grid_list_scss", - src = "grid-list.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "grid_list_scss", + src = "grid-list.scss", + deps = ["//src/material/core:core_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "//src/cdk/bidi", - ":grid-list", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":grid-list", + "//src/cdk/bidi", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":grid-list.md"], + name = "overview", + srcs = [":grid-list.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/icon/BUILD.bazel b/src/material/icon/BUILD.bazel index 7480f187e90..9ba074527d8 100644 --- a/src/material/icon/BUILD.bazel +++ b/src/material/icon/BUILD.bazel @@ -1,83 +1,95 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "icon", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/icon", - assets = [":icon.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/coercion", - "//src/material/core", - ], + name = "icon", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":icon.css"] + glob(["**/*.html"]), + module_name = "@angular/material/icon", + deps = [ + "//src/cdk/coercion", + "//src/material/core", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) sass_library( - name = "icon_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "icon_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "icon_scss", - src = "icon.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "icon_scss", + src = "icon.scss", + deps = ["//src/material/core:core_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/platform-browser", - "//src/cdk/testing", - ":icon", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":icon", + "//src/cdk/testing", + "@npm//@angular/common", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":icon.md"], + name = "overview", + srcs = [":icon.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/input/BUILD.bazel b/src/material/input/BUILD.bazel index 99efe3e7a46..76ada38ba38 100644 --- a/src/material/input/BUILD.bazel +++ b/src/material/input/BUILD.bazel @@ -1,87 +1,99 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "input", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/input", - assets = glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//rxjs", - "//src/cdk/coercion", - "//src/cdk/platform", - "//src/cdk/text-field", - "//src/material/core", - "//src/material/form-field", - ], + name = "input", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = glob(["**/*.html"]), + module_name = "@angular/material/input", + deps = [ + "//src/cdk/coercion", + "//src/cdk/platform", + "//src/cdk/text-field", + "//src/material/core", + "//src/material/form-field", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//rxjs", + ], ) sass_library( - name = "input_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "input_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/platform", - "//src/cdk/testing", - "//src/material/core", - "//src/material/form-field", - "//src/material/stepper", - "//src/material/tabs", - ":input", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":input", + "//src/cdk/bidi", + "//src/cdk/platform", + "//src/cdk/testing", + "//src/material/core", + "//src/material/form-field", + "//src/material/stepper", + "//src/material/tabs", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":input.md"], + name = "overview", + srcs = [":input.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/list/BUILD.bazel b/src/material/list/BUILD.bazel index 124c39195a2..60d5c260545 100644 --- a/src/material/list/BUILD.bazel +++ b/src/material/list/BUILD.bazel @@ -1,93 +1,105 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "list", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/list", - assets = [":list.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/coercion", - "//src/cdk/collections", - "//src/cdk/keycodes", - "//src/material/core", - "//src/material/divider", - ], + name = "list", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":list.css"] + glob(["**/*.html"]), + module_name = "@angular/material/list", + deps = [ + "//src/cdk/a11y", + "//src/cdk/coercion", + "//src/cdk/collections", + "//src/cdk/keycodes", + "//src/material/core", + "//src/material/divider", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//rxjs", + ], ) sass_library( - name = "list_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "list_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "list_scss", - src = "list.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - "//src/material/divider:divider_scss_lib" - ], + name = "list_scss", + src = "list.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + "//src/material/divider:divider_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "//src/cdk/keycodes", - "//src/cdk/testing", - "//src/material/core", - ":list", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":list", + "//src/cdk/keycodes", + "//src/cdk/testing", + "//src/material/core", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":list.md"], + name = "overview", + srcs = [":list.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/menu/BUILD.bazel b/src/material/menu/BUILD.bazel index c7330d6a68c..8ca0040bdfc 100644 --- a/src/material/menu/BUILD.bazel +++ b/src/material/menu/BUILD.bazel @@ -1,98 +1,110 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "menu", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/menu", - assets = [":menu.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/portal", - "//src/cdk/platform", - "//src/material/core", - ], + name = "menu", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":menu.css"] + glob(["**/*.html"]), + module_name = "@angular/material/menu", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/platform", + "//src/cdk/portal", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "menu_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "menu_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "menu_scss", - src = "menu.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "menu_scss", + src = "menu.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/scrolling", - "//src/cdk/testing", - "//src/material/core", - ":menu", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":menu", + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/scrolling", + "//src/cdk/testing", + "//src/material/core", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":menu.md"], + name = "overview", + srcs = [":menu.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/paginator/BUILD.bazel b/src/material/paginator/BUILD.bazel index 5dfb486cb6a..b9fa11c3eea 100644 --- a/src/material/paginator/BUILD.bazel +++ b/src/material/paginator/BUILD.bazel @@ -1,61 +1,72 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "paginator", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/paginator", - assets = [":paginator.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", # TODO(jelbourn): transitive dep via generated code - "@npm//rxjs", - "//src/cdk/coercion", - "//src/material/button", - "//src/material/core", - "//src/material/select", - "//src/material/tooltip", - ], + name = "paginator", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":paginator.css"] + glob(["**/*.html"]), + module_name = "@angular/material/paginator", + deps = [ + "//src/cdk/coercion", + "//src/material/button", + "//src/material/core", + "//src/material/select", + "//src/material/tooltip", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", # TODO(jelbourn): transitive dep via generated code + "@npm//rxjs", + ], ) sass_library( - name = "paginator_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "paginator_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "paginator_scss", - src = "paginator.scss", + name = "paginator_scss", + src = "paginator.scss", ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "//src/cdk/testing", - "//src/material/core", - "//src/material/select", - ":paginator", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":paginator", + "//src/cdk/testing", + "//src/material/core", + "//src/material/select", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":paginator.md"], + name = "overview", + srcs = [":paginator.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/prebuilt-themes/BUILD.bazel b/src/material/prebuilt-themes/BUILD.bazel index 8801773ac7a..501d69e7af9 100644 --- a/src/material/prebuilt-themes/BUILD.bazel +++ b/src/material/prebuilt-themes/BUILD.bazel @@ -1,33 +1,33 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) # We use these genrules to put the prebuilt themes into the bazel-generated npm # package in the right spot. The *right* thing to do would be to move them, but # we would need to update references for Google apps. genrule( - name = "indigo-pink", - srcs = ["//src/material/core:theming/prebuilt/indigo-pink.css"], - outs = ["indigo-pink.css"], - cmd = "cp $< $@", + name = "indigo-pink", + srcs = ["//src/material/core:theming/prebuilt/indigo-pink.css"], + outs = ["indigo-pink.css"], + cmd = "cp $< $@", ) genrule( - name = "deeppurple-amber", - srcs = ["//src/material/core:theming/prebuilt/deeppurple-amber.css"], - outs = ["deeppurple-amber.css"], - cmd = "cp $< $@", + name = "deeppurple-amber", + srcs = ["//src/material/core:theming/prebuilt/deeppurple-amber.css"], + outs = ["deeppurple-amber.css"], + cmd = "cp $< $@", ) genrule( - name = "pink-bluegrey", - srcs = ["//src/material/core:theming/prebuilt/pink-bluegrey.css"], - outs = ["pink-bluegrey.css"], - cmd = "cp $< $@", + name = "pink-bluegrey", + srcs = ["//src/material/core:theming/prebuilt/pink-bluegrey.css"], + outs = ["pink-bluegrey.css"], + cmd = "cp $< $@", ) genrule( - name = "purple-green", - srcs = ["//src/material/core:theming/prebuilt/purple-green.css"], - outs = ["purple-green.css"], - cmd = "cp $< $@", + name = "purple-green", + srcs = ["//src/material/core:theming/prebuilt/purple-green.css"], + outs = ["purple-green.css"], + cmd = "cp $< $@", ) diff --git a/src/material/progress-bar/BUILD.bazel b/src/material/progress-bar/BUILD.bazel index 607dbe554ff..3c9b8a956fb 100644 --- a/src/material/progress-bar/BUILD.bazel +++ b/src/material/progress-bar/BUILD.bazel @@ -1,85 +1,97 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "progress-bar", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/progress-bar", - assets = [":progress-bar.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/platform-browser", - "@npm//@angular/animations", - "@npm//rxjs", - "//src/material/core", - ], + name = "progress-bar", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":progress-bar.css"] + glob(["**/*.html"]), + module_name = "@angular/material/progress-bar", + deps = [ + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) sass_library( - name = "progress_bar_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "progress_bar_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "progress_bar_scss", - src = "progress-bar.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "progress_bar_scss", + src = "progress-bar.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "//src/cdk/testing", - ":progress-bar", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":progress-bar", + "//src/cdk/testing", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":progress-bar.md"], + name = "overview", + srcs = [":progress-bar.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/progress-spinner/BUILD.bazel b/src/material/progress-spinner/BUILD.bazel index b15d882953b..afb70525de7 100644 --- a/src/material/progress-spinner/BUILD.bazel +++ b/src/material/progress-spinner/BUILD.bazel @@ -1,82 +1,94 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "progress-spinner", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/progress-spinner", - assets = [":progress-spinner.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/platform-browser", - "@npm//@angular/animations", - "//src/cdk/coercion", - "//src/cdk/platform", - "//src/material/core", - ], + name = "progress-spinner", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":progress-spinner.css"] + glob(["**/*.html"]), + module_name = "@angular/material/progress-spinner", + deps = [ + "//src/cdk/coercion", + "//src/cdk/platform", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/platform-browser", + ], ) sass_library( - name = "progress_spinner_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "progress_spinner_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "progress_spinner_scss", - src = "progress-spinner.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "progress_spinner_scss", + src = "progress-spinner.scss", + deps = ["//src/material/core:core_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - ":progress-spinner", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":progress-spinner", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":progress-spinner.md"], + name = "overview", + srcs = [":progress-spinner.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/radio/BUILD.bazel b/src/material/radio/BUILD.bazel index f746dd6fdcb..82e0efa8fd9 100644 --- a/src/material/radio/BUILD.bazel +++ b/src/material/radio/BUILD.bazel @@ -1,89 +1,101 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "radio", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/radio", - assets = [":radio.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//@angular/animations", - "//src/cdk/a11y", - "//src/cdk/coercion", - "//src/cdk/collections", - "//src/material/core", - ], + name = "radio", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":radio.css"] + glob(["**/*.html"]), + module_name = "@angular/material/radio", + deps = [ + "//src/cdk/a11y", + "//src/cdk/coercion", + "//src/cdk/collections", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) sass_library( - name = "radio_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "radio_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "radio_scss", - src = "radio.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "radio_scss", + src = "radio.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "//src/cdk/testing", - ":radio", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":radio", + "//src/cdk/testing", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":radio.md"], + name = "overview", + srcs = [":radio.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/schematics/BUILD.bazel b/src/material/schematics/BUILD.bazel index 284f3dfc05d..c44b75dcb37 100644 --- a/src/material/schematics/BUILD.bazel +++ b/src/material/schematics/BUILD.bazel @@ -5,72 +5,87 @@ load("//:packages.bzl", "VERSION_PLACEHOLDER_REPLACEMENTS") load("//tools:defaults.bzl", "jasmine_node_test", "ts_library") filegroup( - name = "schematics_assets", - srcs = glob(["ng-generate/*/files/**/*", "**/*.json"]), + name = "schematics_assets", + srcs = glob([ + "ng-generate/*/files/**/*", + "**/*.json", + ]), ) ts_library( - name = "schematics", - module_name = "@angular/material/schematics", - srcs = glob(["**/*.ts"], exclude=[ - "**/*.spec.ts", - "ng-update/test-cases/**/*.ts", - "ng-generate/*/files/**/*.ts", - ]), - deps = [ - "//src/cdk/schematics", - "@npm//@angular-devkit/core", - "@npm//@angular-devkit/schematics", - "@npm//@schematics/angular", - # TODO(devversion): Only include jasmine for test sources (See: tsconfig types). - "@npm//@types/jasmine", - "@npm//@types/node", - "@npm//tslint", - "@npm//typescript", - ], - tsconfig = ":tsconfig.json", + name = "schematics", + srcs = glob( + ["**/*.ts"], + exclude = [ + "**/*.spec.ts", + "ng-update/test-cases/**/*.ts", + "ng-generate/*/files/**/*.ts", + ], + ), + module_name = "@angular/material/schematics", + tsconfig = ":tsconfig.json", + deps = [ + "//src/cdk/schematics", + "@npm//@angular-devkit/core", + "@npm//@angular-devkit/schematics", + "@npm//@schematics/angular", + # TODO(devversion): Only include jasmine for test sources (See: tsconfig types). + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//tslint", + "@npm//typescript", + ], ) # This package is intended to be combined into the main @angular/material package as a dep. npm_package( - name = "npm_package", - srcs = [":schematics_assets"], - deps = [":schematics"], - replacements = VERSION_PLACEHOLDER_REPLACEMENTS, + name = "npm_package", + srcs = [":schematics_assets"], + replacements = VERSION_PLACEHOLDER_REPLACEMENTS, + deps = [":schematics"], ) ### Testing rules jasmine_node_test( - name = "unit_tests", - srcs = [":unit_test_sources"], - data = [":schematics_assets", ":schematics_test_cases"], + name = "unit_tests", + srcs = [":unit_test_sources"], + data = [ + ":schematics_assets", + ":schematics_test_cases", + ], ) ts_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts", "ng-generate/*/files/**/*.spec.ts"]), - deps = [ - ":schematics", - "//src/cdk/schematics", - "//src/cdk/schematics/testing", - "@npm//@schematics/angular", - "@npm//@angular-devkit/core", - "@npm//@angular-devkit/schematics", - "@npm//@types/fs-extra", - "@npm//@types/node", - "@npm//@types/jasmine", - "@npm//fs-extra", - ], - tsconfig = ":tsconfig.json", - testonly = True, + name = "unit_test_sources", + testonly = True, + srcs = glob( + ["**/*.spec.ts"], + exclude = [ + "**/*.e2e.spec.ts", + "ng-generate/*/files/**/*.spec.ts", + ], + ), + tsconfig = ":tsconfig.json", + deps = [ + ":schematics", + "//src/cdk/schematics", + "//src/cdk/schematics/testing", + "@npm//@angular-devkit/core", + "@npm//@angular-devkit/schematics", + "@npm//@schematics/angular", + "@npm//@types/fs-extra", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//fs-extra", + ], ) filegroup( - name = "schematics_test_cases", - srcs = glob([ - "ng-update/test-cases/**/*_input.ts", - "ng-update/test-cases/**/*_expected_output.ts" - ]), - testonly = True, + name = "schematics_test_cases", + testonly = True, + srcs = glob([ + "ng-update/test-cases/**/*_input.ts", + "ng-update/test-cases/**/*_expected_output.ts", + ]), ) diff --git a/src/material/select/BUILD.bazel b/src/material/select/BUILD.bazel index ece7f491d00..2be153e1df6 100644 --- a/src/material/select/BUILD.bazel +++ b/src/material/select/BUILD.bazel @@ -1,78 +1,89 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "select", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/select", - assets = [":select.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/collections", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/scrolling", - "//src/material/core", - "//src/material/form-field", - ], + name = "select", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":select.css"] + glob(["**/*.html"]), + module_name = "@angular/material/select", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/collections", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/scrolling", + "//src/material/core", + "//src/material/form-field", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//rxjs", + ], ) sass_library( - name = "select_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "select_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "select_scss", - src = "select.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib" - ], + name = "select_scss", + src = "select.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/platform", - "//src/cdk/scrolling", - "//src/cdk/testing", - "//src/material/core", - "//src/material/form-field", - ":select", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":select", + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/platform", + "//src/cdk/scrolling", + "//src/cdk/testing", + "//src/material/core", + "//src/material/form-field", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":select.md"], + name = "overview", + srcs = [":select.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/sidenav/BUILD.bazel b/src/material/sidenav/BUILD.bazel index 376325c2bbd..70a5a154a49 100644 --- a/src/material/sidenav/BUILD.bazel +++ b/src/material/sidenav/BUILD.bazel @@ -1,96 +1,108 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "sidenav", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/sidenav", - assets = [":drawer.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/cdk/platform", - "//src/cdk/scrolling", - "//src/material/core", - ], + name = "sidenav", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":drawer.css"] + glob(["**/*.html"]), + module_name = "@angular/material/sidenav", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/cdk/platform", + "//src/cdk/scrolling", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) sass_library( - name = "sidenav_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "sidenav_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "drawer_scss", - src = "drawer.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "drawer_scss", + src = "drawer.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/platform", - "//src/cdk/scrolling", - "//src/cdk/testing", - ":sidenav", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":sidenav", + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/platform", + "//src/cdk/scrolling", + "//src/cdk/testing", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":sidenav.md"], + name = "overview", + srcs = [":sidenav.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/slide-toggle/BUILD.bazel b/src/material/slide-toggle/BUILD.bazel index 25b2be4121a..58852976d5d 100644 --- a/src/material/slide-toggle/BUILD.bazel +++ b/src/material/slide-toggle/BUILD.bazel @@ -1,92 +1,104 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "slide-toggle", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/slide-toggle", - assets = [":slide-toggle.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//@angular/animations", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/observers", - "//src/material/core", - ], + name = "slide-toggle", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":slide-toggle.css"] + glob(["**/*.html"]), + module_name = "@angular/material/slide-toggle", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/observers", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) sass_library( - name = "slide_toggle_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "slide_toggle_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "slide_toggle_scss", - src = "slide-toggle.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "slide_toggle_scss", + src = "slide-toggle.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "//src/cdk/bidi", - "//src/cdk/observers", - "//src/cdk/testing", - "//src/material/testing", - ":slide-toggle", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":slide-toggle", + "//src/cdk/bidi", + "//src/cdk/observers", + "//src/cdk/testing", + "//src/material/testing", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":slide-toggle.md"], + name = "overview", + srcs = [":slide-toggle.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/slider/BUILD.bazel b/src/material/slider/BUILD.bazel index 92a893b0acd..e2310b5cf43 100644 --- a/src/material/slider/BUILD.bazel +++ b/src/material/slider/BUILD.bazel @@ -1,69 +1,80 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "slider", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/slider", - assets = [":slider.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//@angular/animations", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/material/core", - ], + name = "slider", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":slider.css"] + glob(["**/*.html"]), + module_name = "@angular/material/slider", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) sass_library( - name = "slider_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "slider_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "slider_scss", - src = "slider.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "slider_scss", + src = "slider.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/testing", - "//src/material/testing", - ":slider", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":slider", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/testing", + "//src/material/testing", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":slider.md"], + name = "overview", + srcs = [":slider.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/snack-bar/BUILD.bazel b/src/material/snack-bar/BUILD.bazel index 8380dfbbfe5..f674ce374b3 100644 --- a/src/material/snack-bar/BUILD.bazel +++ b/src/material/snack-bar/BUILD.bazel @@ -1,73 +1,84 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "snack-bar", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/snack-bar", - assets = [ - ":snack-bar-container.css", - ":simple-snack-bar.css", - ] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/layout", - "//src/cdk/overlay", - "//src/cdk/portal", - "//src/material/button", - "//src/material/core", - ], + name = "snack-bar", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [ + ":snack-bar-container.css", + ":simple-snack-bar.css", + ] + glob(["**/*.html"]), + module_name = "@angular/material/snack-bar", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/layout", + "//src/cdk/overlay", + "//src/cdk/portal", + "//src/material/button", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "snack_bar_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "snack_bar_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "snack_bar_container_scss", - src = "snack-bar-container.scss", - deps = ["//src/cdk/a11y:a11y_scss_lib"], + name = "snack_bar_container_scss", + src = "snack-bar-container.scss", + deps = ["//src/cdk/a11y:a11y_scss_lib"], ) sass_binary( - name = "simple_snack_bar_scss", - src = "simple-snack-bar.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "simple_snack_bar_scss", + src = "simple-snack-bar.scss", + deps = ["//src/material/core:core_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/platform-browser", - "//src/cdk/a11y", - "//src/cdk/overlay", - ":snack-bar", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":snack-bar", + "//src/cdk/a11y", + "//src/cdk/overlay", + "@npm//@angular/common", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":snack-bar.md"], + name = "overview", + srcs = [":snack-bar.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/sort/BUILD.bazel b/src/material/sort/BUILD.bazel index a454896a68e..6198519894b 100644 --- a/src/material/sort/BUILD.bazel +++ b/src/material/sort/BUILD.bazel @@ -1,60 +1,71 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "sort", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/sort", - assets = [":sort-header.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/coercion", - "//src/material/core", - ], + name = "sort", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":sort-header.css"] + glob(["**/*.html"]), + module_name = "@angular/material/sort", + deps = [ + "//src/cdk/coercion", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "sort_scss_lib", - srcs = glob(["**/_*.scss"]), + name = "sort_scss_lib", + srcs = glob(["**/_*.scss"]), ) sass_binary( - name = "sort_header_scss", - src = "sort-header.scss", - deps = ["//src/cdk/a11y:a11y_scss_lib"], + name = "sort_header_scss", + src = "sort-header.scss", + deps = ["//src/cdk/a11y:a11y_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/collections", - "//src/cdk/table", - "//src/cdk/testing", - "//src/material/table", - ":sort", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":sort", + "//src/cdk/collections", + "//src/cdk/table", + "//src/cdk/testing", + "//src/material/table", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":sort.md"], + name = "overview", + srcs = [":sort.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/stepper/BUILD.bazel b/src/material/stepper/BUILD.bazel index f3ad2680ea3..45b8865a2ab 100644 --- a/src/material/stepper/BUILD.bazel +++ b/src/material/stepper/BUILD.bazel @@ -1,105 +1,117 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "stepper", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/stepper", - assets = [ - ":stepper.css", - ":step-header.css", - ] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/forms", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/portal", - "//src/cdk/stepper", - "//src/material/button", - "//src/material/core", - "//src/material/icon", - ], + name = "stepper", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [ + ":stepper.css", + ":step-header.css", + ] + glob(["**/*.html"]), + module_name = "@angular/material/stepper", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/portal", + "//src/cdk/stepper", + "//src/material/button", + "//src/material/core", + "//src/material/icon", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/forms", + "@npm//rxjs", + ], ) sass_library( - name = "stepper_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "stepper_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "stepper_scss", - src = "stepper.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "stepper_scss", + src = "stepper.scss", + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "step_header_scss", - src = "step-header.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "step_header_scss", + src = "step-header.scss", + deps = ["//src/material/core:core_scss_lib"], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/forms", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/stepper", - "//src/cdk/testing", - "//src/material/form-field", - "//src/material/input", - "//src/material/core", - ":stepper", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":stepper", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/stepper", + "//src/cdk/testing", + "//src/material/core", + "//src/material/form-field", + "//src/material/input", + "@npm//@angular/forms", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":stepper.md"], + name = "overview", + srcs = [":stepper.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/table/BUILD.bazel b/src/material/table/BUILD.bazel index aa739a89e9d..9149a6e9cbe 100644 --- a/src/material/table/BUILD.bazel +++ b/src/material/table/BUILD.bazel @@ -1,61 +1,72 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "table", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/table", - assets = [":table.css"], - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/coercion", - "//src/cdk/table", - "//src/material/core", - "//src/material/paginator", - "//src/material/sort", - ] + glob(["**/*.html"]), + name = "table", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":table.css"], + module_name = "@angular/material/table", + deps = [ + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + "//src/cdk/coercion", + "//src/cdk/table", + "//src/material/core", + "//src/material/paginator", + "//src/material/sort", + ] + glob(["**/*.html"]), ) sass_library( - name = "table_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "table_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "table_scss", - src = "table.scss", + name = "table_scss", + src = "table.scss", ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/collections", - "//src/material/paginator", - "//src/material/sort", - ":table", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":table", + "//src/cdk/collections", + "//src/material/paginator", + "//src/material/sort", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":table.md"], + name = "overview", + srcs = [":table.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/tabs/BUILD.bazel b/src/material/tabs/BUILD.bazel index b2d96ddd014..bb1160d88f0 100644 --- a/src/material/tabs/BUILD.bazel +++ b/src/material/tabs/BUILD.bazel @@ -1,132 +1,144 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "tabs", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/tabs", - assets = [ - ":tab-body.css", - ":tab-header.css", - ":tab-group.css", - ":tab-nav-bar/tab-nav-bar.css", - ] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/cdk/observers", - "//src/cdk/platform", - "//src/cdk/portal", - "//src/cdk/scrolling", - "//src/material/core", - ], + name = "tabs", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [ + ":tab-body.css", + ":tab-header.css", + ":tab-group.css", + ":tab-nav-bar/tab-nav-bar.css", + ] + glob(["**/*.html"]), + module_name = "@angular/material/tabs", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/cdk/observers", + "//src/cdk/platform", + "//src/cdk/portal", + "//src/cdk/scrolling", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "tabs_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "tabs_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "tab_body_scss", - src = "tab-body.scss", - deps = ["//src/material/core:core_scss_lib"], + name = "tab_body_scss", + src = "tab-body.scss", + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "tab_header_scss", - src = "tab-header.scss", - deps = [ - "//src/material/core:core_scss_lib", - ":tabs_scss_lib", - ], + name = "tab_header_scss", + src = "tab-header.scss", + deps = [ + ":tabs_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "tab_group_scss", - src = "tab-group.scss", - deps = [ - "//src/material/core:core_scss_lib", - ":tabs_scss_lib", - ], + name = "tab_group_scss", + src = "tab-group.scss", + deps = [ + ":tabs_scss_lib", + "//src/material/core:core_scss_lib", + ], ) sass_binary( - name = "tab_nav_bar_scss", - src = "tab-nav-bar/tab-nav-bar.scss", - deps = [ - "//src/material/core:core_scss_lib", - ":tabs_scss_lib", - ], + name = "tab_nav_bar_scss", + src = "tab-nav-bar/tab-nav-bar.scss", + deps = [ + ":tabs_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/observers", - "//src/cdk/portal", - "//src/cdk/scrolling", - "//src/cdk/testing", - "//src/material/core", - ":tabs", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":tabs", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/observers", + "//src/cdk/portal", + "//src/cdk/scrolling", + "//src/cdk/testing", + "//src/material/core", + "@npm//@angular/common", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":tabs.md"], + name = "overview", + srcs = [":tabs.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/testing/BUILD.bazel b/src/material/testing/BUILD.bazel index bd5c21a0ae8..20605d002ec 100644 --- a/src/material/testing/BUILD.bazel +++ b/src/material/testing/BUILD.bazel @@ -1,13 +1,13 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("//tools:defaults.bzl", "ng_module") ng_module( - name = "testing", - module_name = "@angular/material/testing", - srcs = glob(["**/*.ts"]), - deps = [ - "@npm//@angular/core", - "//src/material/core", - ], + name = "testing", + srcs = glob(["**/*.ts"]), + module_name = "@angular/material/testing", + deps = [ + "//src/material/core", + "@npm//@angular/core", + ], ) diff --git a/src/material/toolbar/BUILD.bazel b/src/material/toolbar/BUILD.bazel index 16481cc6c4a..bfb9be95177 100644 --- a/src/material/toolbar/BUILD.bazel +++ b/src/material/toolbar/BUILD.bazel @@ -1,86 +1,94 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html", "ng_e2e_test_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_e2e_test_library", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "toolbar", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/toolbar", - assets = [":toolbar.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "//src/cdk/platform", - "//src/material/core", - ], + name = "toolbar", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":toolbar.css"] + glob(["**/*.html"]), + module_name = "@angular/material/toolbar", + deps = [ + "//src/cdk/platform", + "//src/material/core", + "@npm//@angular/common", + "@npm//@angular/core", + ], ) sass_library( - name = "toolbar_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "toolbar_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "toolbar_scss", - src = "toolbar.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "toolbar_scss", + src = "toolbar.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/platform-browser", - ":toolbar", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":toolbar", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) ng_e2e_test_library( - name = "e2e_test_sources", - srcs = glob(["**/*.e2e.spec.ts"]), - deps = [ - "//src/cdk/testing/e2e", - ] + name = "e2e_test_sources", + srcs = glob(["**/*.e2e.spec.ts"]), + deps = [ + "//src/cdk/testing/e2e", + ], ) protractor_web_test_suite( - name = "e2e_tests", - tags = ["e2e"], - configuration = "//src/e2e-app:protractor.conf.js", - on_prepare = "//src/e2e-app:start-devserver.js", - server = "//src/e2e-app:devserver", - deps = [ - ":e2e_test_sources", - "//src/cdk/testing/e2e", - ], - data = [ - "@npm//@angular/bazel", - "//tools/axe-protractor", - ], + name = "e2e_tests", + configuration = "//src/e2e-app:protractor.conf.js", + data = [ + "//tools/axe-protractor", + "@npm//@angular/bazel", + ], + on_prepare = "//src/e2e-app:start-devserver.js", + server = "//src/e2e-app:devserver", + tags = ["e2e"], + deps = [ + ":e2e_test_sources", + "//src/cdk/testing/e2e", + ], ) markdown_to_html( - name = "overview", - srcs = [":toolbar.md"], + name = "overview", + srcs = [":toolbar.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) - - - - diff --git a/src/material/tooltip/BUILD.bazel b/src/material/tooltip/BUILD.bazel index c38b5d5b2b4..26941a9a5b4 100644 --- a/src/material/tooltip/BUILD.bazel +++ b/src/material/tooltip/BUILD.bazel @@ -1,75 +1,86 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "tooltip", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/tooltip", - assets = [":tooltip.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/platform-browser", - "@npm//rxjs", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/coercion", - "//src/cdk/keycodes", - "//src/cdk/layout", - "//src/cdk/overlay", - "//src/cdk/platform", - "//src/cdk/portal", - "//src/cdk/scrolling", - "//src/material/core", - ], + name = "tooltip", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":tooltip.css"] + glob(["**/*.html"]), + module_name = "@angular/material/tooltip", + deps = [ + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/coercion", + "//src/cdk/keycodes", + "//src/cdk/layout", + "//src/cdk/overlay", + "//src/cdk/platform", + "//src/cdk/portal", + "//src/cdk/scrolling", + "//src/material/core", + "@npm//@angular/animations", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//@angular/platform-browser", + "@npm//rxjs", + ], ) sass_library( - name = "tooltip_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "tooltip_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "tooltip_scss", - src = "tooltip.scss", - deps = [ - "//src/cdk/a11y:a11y_scss_lib", - "//src/material/core:core_scss_lib", - ], + name = "tooltip_scss", + src = "tooltip.scss", + deps = [ + "//src/cdk/a11y:a11y_scss_lib", + "//src/material/core:core_scss_lib", + ], ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//@angular/animations", - "@npm//@angular/platform-browser", - "//src/cdk/a11y", - "//src/cdk/bidi", - "//src/cdk/keycodes", - "//src/cdk/overlay", - "//src/cdk/platform", - "//src/cdk/testing", - ":tooltip", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":tooltip", + "//src/cdk/a11y", + "//src/cdk/bidi", + "//src/cdk/keycodes", + "//src/cdk/overlay", + "//src/cdk/platform", + "//src/cdk/testing", + "@npm//@angular/animations", + "@npm//@angular/platform-browser", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":tooltip.md"], + name = "overview", + srcs = [":tooltip.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/src/material/tree/BUILD.bazel b/src/material/tree/BUILD.bazel index 04066f9c947..741c0002727 100644 --- a/src/material/tree/BUILD.bazel +++ b/src/material/tree/BUILD.bazel @@ -1,56 +1,67 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary") -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite", - "markdown_to_html") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) ng_module( - name = "tree", - srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), - module_name = "@angular/material/tree", - assets = [":tree.css"] + glob(["**/*.html"]), - deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//rxjs", - "//src/cdk/collections", - "//src/cdk/tree", - "//src/material/core", - ], + name = "tree", + srcs = glob( + ["**/*.ts"], + exclude = ["**/*.spec.ts"], + ), + assets = [":tree.css"] + glob(["**/*.html"]), + module_name = "@angular/material/tree", + deps = [ + "//src/cdk/collections", + "//src/cdk/tree", + "//src/material/core", + "@npm//@angular/common", + "@npm//@angular/core", + "@npm//rxjs", + ], ) sass_library( - name = "tree_scss_lib", - srcs = glob(["**/_*.scss"]), - deps = ["//src/material/core:core_scss_lib"], + name = "tree_scss_lib", + srcs = glob(["**/_*.scss"]), + deps = ["//src/material/core:core_scss_lib"], ) sass_binary( - name = "tree_scss", - src = "tree.scss", + name = "tree_scss", + src = "tree.scss", ) ng_test_library( - name = "unit_test_sources", - srcs = glob(["**/*.spec.ts"], exclude = ["**/*.e2e.spec.ts"]), - deps = [ - "@npm//rxjs", - "//src/cdk/tree", - ":tree", - ] + name = "unit_test_sources", + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/*.e2e.spec.ts"], + ), + deps = [ + ":tree", + "//src/cdk/tree", + "@npm//rxjs", + ], ) ng_web_test_suite( - name = "unit_tests", - deps = [":unit_test_sources"], + name = "unit_tests", + deps = [":unit_test_sources"], ) markdown_to_html( - name = "overview", - srcs = [":tree.md"], + name = "overview", + srcs = [":tree.md"], ) filegroup( - name = "source-files", - srcs = glob(["**/*.ts"]), + name = "source-files", + srcs = glob(["**/*.ts"]), ) diff --git a/test/BUILD.bazel b/test/BUILD.bazel index b941615beee..3e591572c68 100644 --- a/test/BUILD.bazel +++ b/test/BUILD.bazel @@ -1,16 +1,16 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("//tools:defaults.bzl", "ts_library") # Common set-up for all Angular Material and CDK tests. ts_library( - name = "angular_test_init", - testonly = True, - deps = [ - "@npm//@angular/core", - "@npm//@angular/platform-browser-dynamic", - "@npm//@types/jasmine", - ], - # This file *must* end with "spec" in order for ts_web_test to load it. - srcs = ["angular-test-init-spec.ts"], + name = "angular_test_init", + testonly = True, + # This file *must* end with "spec" in order for ts_web_test to load it. + srcs = ["angular-test-init-spec.ts"], + deps = [ + "@npm//@angular/core", + "@npm//@angular/platform-browser-dynamic", + "@npm//@types/jasmine", + ], ) diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index 1b318350625..19601eda346 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -1,32 +1,33 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) + load("//tools:defaults.bzl", "ts_library") load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") ts_library( - name = "sass_bundle_lib", - srcs = ["sass-bundle.ts"], - deps = [ - "@npm//@types/node", - "@npm//scss-bundle", - ], - tsconfig = "bazel-tools-tsconfig.json", + name = "sass_bundle_lib", + srcs = ["sass-bundle.ts"], + tsconfig = "bazel-tools-tsconfig.json", + deps = [ + "@npm//@types/node", + "@npm//scss-bundle", + ], ) # Executable for the custom sass_bundle rule (see sass_bundle.bzl). nodejs_binary( - name = "sass_bundle", - data = [ - "@npm//scss-bundle", - ":sass_bundle_lib", - ], - entry_point = "angular_material/tools/sass-bundle.js", + name = "sass_bundle", + data = [ + ":sass_bundle_lib", + "@npm//scss-bundle", + ], + entry_point = "angular_material/tools/sass-bundle.js", ) # Workaround for https://github.com/bazelbuild/bazel-toolchains/issues/356. We need the # "SYS_ADMIN" capability in order to run browsers with sandbox enabled. platform( - name = "rbe_platform", - parents = ["@rbe_default//config:platform"], + name = "rbe_platform", + parents = ["@rbe_default//config:platform"], remote_execution_properties = """ {PARENT_REMOTE_EXECUTION_PROPERTIES} properties: { diff --git a/tools/axe-protractor/BUILD.bazel b/tools/axe-protractor/BUILD.bazel index 0574eea4ead..34dbecd3152 100644 --- a/tools/axe-protractor/BUILD.bazel +++ b/tools/axe-protractor/BUILD.bazel @@ -1,11 +1,11 @@ package(default_visibility = ["//visibility:public"]) filegroup( - name = "axe-protractor", - srcs = [ - "index.js", - "build-message.js", - # "axe-webdriver" is required to run "axe-protractor". - "@npm//axe-webdriverjs", - ], + name = "axe-protractor", + srcs = [ + "index.js", + "build-message.js", + # "axe-webdriver" is required to run "axe-protractor". + "@npm//axe-webdriverjs", + ], ) diff --git a/tools/defaults.bzl b/tools/defaults.bzl index 1169832b82b..df961b7108f 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -5,7 +5,7 @@ load("@npm_bazel_jasmine//:index.bzl", _jasmine_node_test = "jasmine_node_test") load("@npm_bazel_typescript//:defs.bzl", _ts_library = "ts_library") load("@npm_bazel_karma//:defs.bzl", _ts_web_test_suite = "ts_web_test_suite") load("//tools/markdown-to-html:index.bzl", _markdown_to_html = "markdown_to_html") -load("//:packages.bzl", "VERSION_PLACEHOLDER_REPLACEMENTS", "ANGULAR_LIBRARY_UMDS") +load("//:packages.bzl", "ANGULAR_LIBRARY_UMDS", "VERSION_PLACEHOLDER_REPLACEMENTS") _DEFAULT_TSCONFIG_BUILD = "//src:bazel-tsconfig-build.json" _DEFAULT_TSCONFIG_TEST = "//src:bazel-tsconfig-test.json" @@ -20,131 +20,131 @@ _ENABLE_NG_TYPE_CHECKING = True markdown_to_html = _markdown_to_html def _getDefaultTsConfig(testonly): - if testonly: - return _DEFAULT_TSCONFIG_TEST - else: - return _DEFAULT_TSCONFIG_BUILD + if testonly: + return _DEFAULT_TSCONFIG_TEST + else: + return _DEFAULT_TSCONFIG_BUILD def ts_library(tsconfig = None, deps = [], testonly = False, **kwargs): - # Add tslib because we use import helpers for all public packages. - local_deps = ["@npm//tslib"] + deps + # Add tslib because we use import helpers for all public packages. + local_deps = ["@npm//tslib"] + deps - if not tsconfig: - tsconfig = _getDefaultTsConfig(testonly) + if not tsconfig: + tsconfig = _getDefaultTsConfig(testonly) - _ts_library( - tsconfig = tsconfig, - testonly = testonly, - deps = local_deps, - node_modules = _DEFAULT_TS_TYPINGS, - **kwargs - ) + _ts_library( + tsconfig = tsconfig, + testonly = testonly, + deps = local_deps, + node_modules = _DEFAULT_TS_TYPINGS, + **kwargs + ) def ng_module(deps = [], tsconfig = None, testonly = False, **kwargs): - if not tsconfig: - tsconfig = _getDefaultTsConfig(testonly) + if not tsconfig: + tsconfig = _getDefaultTsConfig(testonly) - local_deps = [ - # Add tslib because we use import helpers for all public packages. - "@npm//tslib", - "@npm//@angular/platform-browser", + local_deps = [ + # Add tslib because we use import helpers for all public packages. + "@npm//tslib", + "@npm//@angular/platform-browser", - # Depend on the module typings for each `ng_module`. Since all components within the project - # need to use `module.id` when creating components, this is always a dependency. - "//src:module-typings" - ] + # Depend on the module typings for each `ng_module`. Since all components within the project + # need to use `module.id` when creating components, this is always a dependency. + "//src:module-typings", + ] - # Append given deps only if they're not in the default set of deps - for d in deps: - if d not in local_deps: - local_deps = local_deps + [d] + # Append given deps only if they're not in the default set of deps + for d in deps: + if d not in local_deps: + local_deps = local_deps + [d] - _ng_module( - type_check = _ENABLE_NG_TYPE_CHECKING, - deps = local_deps, - tsconfig = tsconfig, - testonly = testonly, - node_modules = _DEFAULT_TS_TYPINGS, - **kwargs - ) + _ng_module( + type_check = _ENABLE_NG_TYPE_CHECKING, + deps = local_deps, + tsconfig = tsconfig, + testonly = testonly, + node_modules = _DEFAULT_TS_TYPINGS, + **kwargs + ) def ng_package(name, readme_md = None, **kwargs): - # If no readme file has been specified explicitly, use the default readme for - # release packages from "src/README.md". - if not readme_md: - readme_md = "//src:README.md" + # If no readme file has been specified explicitly, use the default readme for + # release packages from "src/README.md". + if not readme_md: + readme_md = "//src:README.md" - _ng_package( - name = name, - readme_md = readme_md, - replacements = VERSION_PLACEHOLDER_REPLACEMENTS, - **kwargs - ) + _ng_package( + name = name, + readme_md = readme_md, + replacements = VERSION_PLACEHOLDER_REPLACEMENTS, + **kwargs + ) def jasmine_node_test(**kwargs): - _jasmine_node_test(**kwargs) + _jasmine_node_test(**kwargs) def ng_test_library(deps = [], tsconfig = None, **kwargs): - local_deps = [ - # We declare "@angular/core" as default dependencies because - # all Angular component unit tests use the `TestBed` and `Component` exports. - "@npm//@angular/core", - "@npm//@types/jasmine", - ] + deps; + local_deps = [ + # We declare "@angular/core" as default dependencies because + # all Angular component unit tests use the `TestBed` and `Component` exports. + "@npm//@angular/core", + "@npm//@types/jasmine", + ] + deps - ts_library( - testonly = 1, - deps = local_deps, - **kwargs - ) + ts_library( + testonly = 1, + deps = local_deps, + **kwargs + ) def ng_e2e_test_library(deps = [], tsconfig = None, **kwargs): - local_deps = [ - "@npm//@types/jasmine", - "@npm//@types/selenium-webdriver", - "@npm//protractor", - ] + deps; + local_deps = [ + "@npm//@types/jasmine", + "@npm//@types/selenium-webdriver", + "@npm//protractor", + ] + deps - ts_library( - testonly = 1, - deps = local_deps, - **kwargs - ) + ts_library( + testonly = 1, + deps = local_deps, + **kwargs + ) def ts_web_test_suite(deps = [], srcs = [], **kwargs): - _ts_web_test_suite( - deps = ["//tools/rxjs:rxjs_umd_modules"] + deps, - # Required for running the compiled ng modules that use TypeScript import helpers. - # TODO(jelbourn): remove UMDs from here once we don't have to manually include them - srcs = [ - "@npm//node_modules/tslib:tslib.js", - ] + ANGULAR_LIBRARY_UMDS + srcs, - **kwargs - ) + _ts_web_test_suite( + deps = ["//tools/rxjs:rxjs_umd_modules"] + deps, + # Required for running the compiled ng modules that use TypeScript import helpers. + # TODO(jelbourn): remove UMDs from here once we don't have to manually include them + srcs = [ + "@npm//node_modules/tslib:tslib.js", + ] + ANGULAR_LIBRARY_UMDS + srcs, + **kwargs + ) def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], **kwargs): - # Always include a prebuilt theme in the test suite because otherwise tests, which depend on CSS - # that is needed for measuring, will unexpectedly fail. Also always adding a prebuilt theme - # reduces the amount of setup that is needed to create a test suite Bazel target. Note that the - # prebuilt theme will be also added to CDK test suites but shouldn't affect anything. - static_css = static_css + ["//src/material/prebuilt-themes:indigo-pink"] + # Always include a prebuilt theme in the test suite because otherwise tests, which depend on CSS + # that is needed for measuring, will unexpectedly fail. Also always adding a prebuilt theme + # reduces the amount of setup that is needed to create a test suite Bazel target. Note that the + # prebuilt theme will be also added to CDK test suites but shouldn't affect anything. + static_css = static_css + ["//src/material/prebuilt-themes:indigo-pink"] - # Workaround for https://github.com/bazelbuild/rules_typescript/issues/301 - # Since some of our tests depend on CSS files which are not part of the `ng_module` rule, - # we need to somehow load static CSS files within Karma (e.g. overlay prebuilt). Those styles - # are required for successful test runs. Since the `ts_web_test_suite` rule currently only - # allows JS files to be included and served within Karma, we need to create a JS file that - # loads the given CSS file. - for css_label in static_css: - css_id = "static-css-file-%s" % (css_label.replace("/", "_").replace(":", "-")) - deps += [":%s" % css_id] + # Workaround for https://github.com/bazelbuild/rules_typescript/issues/301 + # Since some of our tests depend on CSS files which are not part of the `ng_module` rule, + # we need to somehow load static CSS files within Karma (e.g. overlay prebuilt). Those styles + # are required for successful test runs. Since the `ts_web_test_suite` rule currently only + # allows JS files to be included and served within Karma, we need to create a JS file that + # loads the given CSS file. + for css_label in static_css: + css_id = "static-css-file-%s" % (css_label.replace("/", "_").replace(":", "-")) + deps += [":%s" % css_id] - native.genrule( - name = css_id, - srcs = [css_label], - outs = ["%s.js" % css_id], - output_to_bindir = True, - cmd = """ + native.genrule( + name = css_id, + srcs = [css_label], + outs = ["%s.js" % css_id], + output_to_bindir = True, + cmd = """ files=($(locations %s)) css_content=$$(cat $${files[0]}) js_template="var cssElement = document.createElement('style'); \ @@ -153,18 +153,18 @@ def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], **kwargs): document.head.appendChild(cssElement);" echo $$js_template > $@ - """ % css_label - ) + """ % css_label, + ) - ts_web_test_suite( - # Depend on our custom test initialization script. This needs to be the first dependency. - deps = [ - "//test:angular_test_init", - ] + deps, - bootstrap = [ - "@npm//node_modules/zone.js:dist/zone-testing-bundle.js", - "@npm//node_modules/reflect-metadata:Reflect.js", - "@npm//node_modules/hammerjs:hammer.js", - ] + bootstrap, - **kwargs - ) + ts_web_test_suite( + # Depend on our custom test initialization script. This needs to be the first dependency. + deps = [ + "//test:angular_test_init", + ] + deps, + bootstrap = [ + "@npm//node_modules/zone.js:dist/zone-testing-bundle.js", + "@npm//node_modules/reflect-metadata:Reflect.js", + "@npm//node_modules/hammerjs:hammer.js", + ] + bootstrap, + **kwargs + ) diff --git a/tools/dgeni/BUILD.bazel b/tools/dgeni/BUILD.bazel index 15691781562..a6b96c55730 100644 --- a/tools/dgeni/BUILD.bazel +++ b/tools/dgeni/BUILD.bazel @@ -4,24 +4,24 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") load("//tools:defaults.bzl", "ts_library") nodejs_binary( - name = "dgeni", - entry_point = "angular_material/tools/dgeni/bazel-bin.js", - data = [ - "@npm//dgeni", - "@npm//dgeni-packages", - ":sources", - ], + name = "dgeni", + data = [ + ":sources", + "@npm//dgeni", + "@npm//dgeni-packages", + ], + entry_point = "angular_material/tools/dgeni/bazel-bin.js", ) ts_library( - name = "sources", - srcs = glob(["**/*.ts"]), - deps = [ - "@npm//@types/node", - "@npm//dgeni", - "@npm//dgeni-packages", - "@npm//highlight.js", - "//tools/highlight-files:sources", - ], - tsconfig = ":tsconfig.json", + name = "sources", + srcs = glob(["**/*.ts"]), + tsconfig = ":tsconfig.json", + deps = [ + "//tools/highlight-files:sources", + "@npm//@types/node", + "@npm//dgeni", + "@npm//dgeni-packages", + "@npm//highlight.js", + ], ) diff --git a/tools/dgeni/index.bzl b/tools/dgeni/index.bzl index 7c19b1e03a9..bb14ead60bd 100644 --- a/tools/dgeni/index.bzl +++ b/tools/dgeni/index.bzl @@ -2,96 +2,98 @@ Implementation of the "_dgeni_api_docs" rule. The implementation runs Dgeni with the specified entry points and outputs the API docs into a package relative directory. """ + def _dgeni_api_docs(ctx): - input_files = ctx.files.srcs; - args = ctx.actions.args() - expected_outputs = []; + input_files = ctx.files.srcs + args = ctx.actions.args() + expected_outputs = [] - output_dir_name = ctx.attr.name; - output_dir_path = "%s/%s/%s" % (ctx.bin_dir.path, ctx.label.package, output_dir_name) + output_dir_name = ctx.attr.name + output_dir_path = "%s/%s/%s" % (ctx.bin_dir.path, ctx.label.package, output_dir_name) - # Do nothing if there are no input files. Bazel will throw if we schedule an action - # that returns no outputs. - if not input_files: - return None + # Do nothing if there are no input files. Bazel will throw if we schedule an action + # that returns no outputs. + if not input_files: + return None - # Support passing arguments through a parameter file. This is necessary because on Windows - # there is an argument limit and we need to handle a large amount of input files. Bazel - # switches between parameter file and normal argument passing based on the operating system. - # Read more here: https://docs.bazel.build/versions/master/skylark/lib/Args.html#use_param_file - args.use_param_file(param_file_arg = "--param-file=%s") + # Support passing arguments through a parameter file. This is necessary because on Windows + # there is an argument limit and we need to handle a large amount of input files. Bazel + # switches between parameter file and normal argument passing based on the operating system. + # Read more here: https://docs.bazel.build/versions/master/skylark/lib/Args.html#use_param_file + args.use_param_file(param_file_arg = "--param-file=%s") - # Pass the path to the package that contains the current Bazel target that is being built. - # This will be used as a base path to resolve TypeScript source files within Dgeni. - args.add(ctx.label.package) + # Pass the path to the package that contains the current Bazel target that is being built. + # This will be used as a base path to resolve TypeScript source files within Dgeni. + args.add(ctx.label.package) - # Pass the path to the output directory. This will be used to instruct Dgeni where the docs - # output should be written to. (e.g. bazel-out/bin/src/docs-content) - args.add(output_dir_path) + # Pass the path to the output directory. This will be used to instruct Dgeni where the docs + # output should be written to. (e.g. bazel-out/bin/src/docs-content) + args.add(output_dir_path) - # Pass each specified entry point and it's corresponding entry points to Dgeni. This will then - # be used to resolve the files that need to be parsed by Dgeni. - for package_name, entry_points in ctx.attr.entry_points.items(): - args.add(package_name) - args.add_joined(entry_points, join_with = ",") + # Pass each specified entry point and it's corresponding entry points to Dgeni. This will then + # be used to resolve the files that need to be parsed by Dgeni. + for package_name, entry_points in ctx.attr.entry_points.items(): + args.add(package_name) + args.add_joined(entry_points, join_with = ",") - for entry_point in entry_points: - expected_outputs += [ - # Declare the output for the current entry-point. The output file will always follow the - # same format: "{output_folder}/{package_name}-{entry_point_name}.html" - # (e.g. "api-docs/material-slider.html") - ctx.actions.declare_file("%s/%s-%s.html" % (output_dir_name, package_name, entry_point)) - ] + for entry_point in entry_points: + expected_outputs += [ + # Declare the output for the current entry-point. The output file will always follow the + # same format: "{output_folder}/{package_name}-{entry_point_name}.html" + # (e.g. "api-docs/material-slider.html") + ctx.actions.declare_file("%s/%s-%s.html" % (output_dir_name, package_name, entry_point)), + ] - # Small workaround that ensures that the "ripple" API doc is properly exposed as an output - # of the packaging rule. Technically Dgeni should not output the "ripple" directory as - # it's own entry-point. TODO(devversion): Support sub API docs for entry-points - if package_name == "material": - expected_outputs += [ - ctx.actions.declare_file("%s/%s-%s.html" % (output_dir_name, package_name, "ripple")) - ] + # Small workaround that ensures that the "ripple" API doc is properly exposed as an output + # of the packaging rule. Technically Dgeni should not output the "ripple" directory as + # it's own entry-point. TODO(devversion): Support sub API docs for entry-points + if package_name == "material": + expected_outputs += [ + ctx.actions.declare_file("%s/%s-%s.html" % (output_dir_name, package_name, "ripple")), + ] - # Run the Dgeni bazel executable which builds the documentation output based on the - # configured rule attributes. - ctx.actions.run( - # Note that we want to add the dgeni template files as well. This makes sure that the - # templates are available in the sandbox execution and can be read by Dgeni. - inputs = input_files + ctx.files._dgeni_templates, - executable = ctx.executable._dgeni_bin, - outputs = expected_outputs, - arguments = [args], - progress_message = "Dgeni (%s)" % (output_dir_path), - ) + # Run the Dgeni bazel executable which builds the documentation output based on the + # configured rule attributes. + ctx.actions.run( + # Note that we want to add the dgeni template files as well. This makes sure that the + # templates are available in the sandbox execution and can be read by Dgeni. + inputs = input_files + ctx.files._dgeni_templates, + executable = ctx.executable._dgeni_bin, + outputs = expected_outputs, + arguments = [args], + progress_message = "Dgeni (%s)" % (output_dir_path), + ) - return DefaultInfo(files = depset(expected_outputs)) + return DefaultInfo(files = depset(expected_outputs)) """ Rule definition for the "dgeni_api_docs" rule that can generate API documentation for specified packages and their entry points. """ dgeni_api_docs = rule( - implementation = _dgeni_api_docs, - attrs = { - # List of labels that need to be available when Dgeni processes the entry points. - # This usually contains the source files and Angular packages which will be read - # by the dgeni-packages typeScript processor. - "srcs": attr.label_list(allow_files = True), + implementation = _dgeni_api_docs, + attrs = { + # List of labels that need to be available when Dgeni processes the entry points. + # This usually contains the source files and Angular packages which will be read + # by the dgeni-packages typeScript processor. + "srcs": attr.label_list(allow_files = True), - # String dictionary that defines a package and its entry points. e.g. - # { "cdk": ["a11y", "platform", "bidi"] }. - "entry_points": attr.string_list_dict(mandatory = True), + # String dictionary that defines a package and its entry points. e.g. + # { "cdk": ["a11y", "platform", "bidi"] }. + "entry_points": attr.string_list_dict(mandatory = True), - # Dgeni document templates that should be be available as inputs to the - # Bazel action. Dgeni tries to resolve templates from the execroot, so they - # need to be available in the sandbox. - "_dgeni_templates": attr.label( - default = Label("//tools/dgeni/templates"), - ), + # Dgeni document templates that should be be available as inputs to the + # Bazel action. Dgeni tries to resolve templates from the execroot, so they + # need to be available in the sandbox. + "_dgeni_templates": attr.label( + default = Label("//tools/dgeni/templates"), + ), - # NodeJS binary target that runs Dgeni and parses the passed command arguments. - "_dgeni_bin": attr.label( - default = Label("//tools/dgeni"), - executable = True, - cfg = "host" - )}, + # NodeJS binary target that runs Dgeni and parses the passed command arguments. + "_dgeni_bin": attr.label( + default = Label("//tools/dgeni"), + executable = True, + cfg = "host", + ), + }, ) diff --git a/tools/dgeni/templates/BUILD.bazel b/tools/dgeni/templates/BUILD.bazel index b41423bbb6b..bc53d7e04b3 100644 --- a/tools/dgeni/templates/BUILD.bazel +++ b/tools/dgeni/templates/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) filegroup( - name = "templates", - srcs = glob(["*.html"]) -) \ No newline at end of file + name = "templates", + srcs = glob(["*.html"]), +) diff --git a/tools/example-module/BUILD.bazel b/tools/example-module/BUILD.bazel index 22ac4564528..4c96ecce2c9 100644 --- a/tools/example-module/BUILD.bazel +++ b/tools/example-module/BUILD.bazel @@ -1,24 +1,24 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") load("//tools:defaults.bzl", "ts_library") ts_library( - name = "example-module-lib", - srcs = glob(["**/*.ts"]), - deps = [ - "@npm//@types/node", - "@npm//typescript", - ], - tsconfig = ":tsconfig.json", + name = "example-module-lib", + srcs = glob(["**/*.ts"]), + tsconfig = ":tsconfig.json", + deps = [ + "@npm//@types/node", + "@npm//typescript", + ], ) nodejs_binary( - name = "bazel-bin", - entry_point = "angular_material/tools/example-module/bazel-bin.js", - data = [ - "@npm//typescript", - ":example-module-lib", - ":example-module.template", - ], + name = "bazel-bin", + data = [ + ":example-module.template", + ":example-module-lib", + "@npm//typescript", + ], + entry_point = "angular_material/tools/example-module/bazel-bin.js", ) diff --git a/tools/highlight-files/BUILD.bazel b/tools/highlight-files/BUILD.bazel index 7c9521f8c89..6127782c63a 100644 --- a/tools/highlight-files/BUILD.bazel +++ b/tools/highlight-files/BUILD.bazel @@ -4,19 +4,19 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") load("//tools:defaults.bzl", "ts_library") ts_library( - name = "sources", - srcs = glob(["**/*.ts"]), - deps = [ - "@npm//@types/node", - ], - tsconfig = ":tsconfig.json", + name = "sources", + srcs = glob(["**/*.ts"]), + tsconfig = ":tsconfig.json", + deps = [ + "@npm//@types/node", + ], ) nodejs_binary( - name = "highlight-files", - entry_point = "angular_material/tools/highlight-files/highlight-files.js", - data = [ - "@npm//highlight.js", - ":sources", - ], + name = "highlight-files", + data = [ + ":sources", + "@npm//highlight.js", + ], + entry_point = "angular_material/tools/highlight-files/highlight-files.js", ) diff --git a/tools/highlight-files/index.bzl b/tools/highlight-files/index.bzl index e2e111ffb0e..e1c65a8504f 100644 --- a/tools/highlight-files/index.bzl +++ b/tools/highlight-files/index.bzl @@ -3,66 +3,67 @@ package path from the specified path. e.g. the path is "guides/test/my-text.md" and the label package is "guides/". The expected path would be "test/my-text.md". """ + def _relative_to_label(label, short_path): - # TODO(devversion): extract into generic utility under tools/ - return short_path[len(label.package) + 1:] + # TODO(devversion): extract into generic utility under tools/ + return short_path[len(label.package) + 1:] """ Implementation of the "highlight_files" rule. The implementation runs the highlight-files executable in order to highlight the specified source files. """ + def _highlight_files(ctx): - input_files = ctx.files.srcs; - args = ctx.actions.args() - expected_outputs = []; + input_files = ctx.files.srcs + args = ctx.actions.args() + expected_outputs = [] - # Do nothing if there are no input files. Bazel will throw if we schedule an action - # that returns no outputs. - if not input_files: - return None + # Do nothing if there are no input files. Bazel will throw if we schedule an action + # that returns no outputs. + if not input_files: + return None - # Support passing arguments through a parameter file. This is necessary because on Windows - # there is an argument limit and we need to handle a large amount of input files. Bazel - # switches between parameter file and normal argument passing based on the operating system. - # Read more here: https://docs.bazel.build/versions/master/skylark/lib/Args.html#use_param_file - args.use_param_file(param_file_arg = "--param-file=%s") + # Support passing arguments through a parameter file. This is necessary because on Windows + # there is an argument limit and we need to handle a large amount of input files. Bazel + # switches between parameter file and normal argument passing based on the operating system. + # Read more here: https://docs.bazel.build/versions/master/skylark/lib/Args.html#use_param_file + args.use_param_file(param_file_arg = "--param-file=%s") - # Add the bazel bin directory to the command arguments. The script needs to know about - # the output directory because the input files are not in the same location as the bazel - # bin directory. - args.add(ctx.bin_dir.path) + # Add the bazel bin directory to the command arguments. The script needs to know about + # the output directory because the input files are not in the same location as the bazel + # bin directory. + args.add(ctx.bin_dir.path) - for input_file in input_files: - # Extension of the input file (e.g. "ts" or "css") - file_extension = input_file.extension + for input_file in input_files: + # Extension of the input file (e.g. "ts" or "css") + file_extension = input_file.extension - # Determine the input file path relatively to the current package path. This is necessary - # because we want to preserve directories for the input files and `declare_file` expects a - # path that is relative to the current package. We remove the file extension including the dot - # because we will constructo an output file using a different extension. - relative_basepath = _relative_to_label(ctx.label, input_file.short_path)[ - :-len(file_extension) - 1] + # Determine the input file path relatively to the current package path. This is necessary + # because we want to preserve directories for the input files and `declare_file` expects a + # path that is relative to the current package. We remove the file extension including the dot + # because we will constructo an output file using a different extension. + relative_basepath = _relative_to_label(ctx.label, input_file.short_path)[:-len(file_extension) - 1] - # Construct the output path from the relative basepath and file extension. For example: - # "autocomplete.ts" should result in "autocomplete-ts.html". - expected_outputs += [ - ctx.actions.declare_file("%s-%s.html" % (relative_basepath, file_extension)), - ] + # Construct the output path from the relative basepath and file extension. For example: + # "autocomplete.ts" should result in "autocomplete-ts.html". + expected_outputs += [ + ctx.actions.declare_file("%s-%s.html" % (relative_basepath, file_extension)), + ] - # Add the path for the input file to the command line arguments, so that the executable - # can process it. - args.add(input_file.path) + # Add the path for the input file to the command line arguments, so that the executable + # can process it. + args.add(input_file.path) - # Run the highlight-files executable that highlights the specified source files. - ctx.actions.run( - inputs = input_files, - executable = ctx.executable._highlight_files, - outputs = expected_outputs, - arguments = [args], - progress_message = "HighlightFiles", - ) + # Run the highlight-files executable that highlights the specified source files. + ctx.actions.run( + inputs = input_files, + executable = ctx.executable._highlight_files, + outputs = expected_outputs, + arguments = [args], + progress_message = "HighlightFiles", + ) - return DefaultInfo(files = depset(expected_outputs)) + return DefaultInfo(files = depset(expected_outputs)) """ Rule definition for the "highlight_files" rule that can accept arbritary source files @@ -70,15 +71,16 @@ def _highlight_files(ctx): the given files. The outputs can be referenced through the default output provider. """ highlight_files = rule( - implementation = _highlight_files, - attrs = { - "srcs": attr.label_list(allow_files = True), + implementation = _highlight_files, + attrs = { + "srcs": attr.label_list(allow_files = True), - # Executable for this rule that is responsible for highlighting the specified - # input files. - "_highlight_files": attr.label( - default = Label("//tools/highlight-files"), - executable = True, - cfg = "host" - )}, + # Executable for this rule that is responsible for highlighting the specified + # input files. + "_highlight_files": attr.label( + default = Label("//tools/highlight-files"), + executable = True, + cfg = "host", + ), + }, ) diff --git a/tools/markdown-to-html/BUILD.bazel b/tools/markdown-to-html/BUILD.bazel index 916773bf6c3..0a74e51c4d4 100644 --- a/tools/markdown-to-html/BUILD.bazel +++ b/tools/markdown-to-html/BUILD.bazel @@ -4,24 +4,22 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") load("//tools:defaults.bzl", "ts_library") ts_library( - name = "transform-markdown", - srcs = glob(["**/*.ts"]), - deps = [ - "@npm//@types/node", - "@npm//@types/marked", - "//tools/highlight-files:sources", - ], - tsconfig = ":tsconfig.json", + name = "transform-markdown", + srcs = glob(["**/*.ts"]), + tsconfig = ":tsconfig.json", + deps = [ + "//tools/highlight-files:sources", + "@npm//@types/marked", + "@npm//@types/node", + ], ) nodejs_binary( - name = "markdown-to-html", - entry_point = "angular_material/tools/markdown-to-html/transform-markdown.js", - data = [ - "@npm//marked", - "@npm//highlight.js", - ":transform-markdown", - ], + name = "markdown-to-html", + data = [ + ":transform-markdown", + "@npm//highlight.js", + "@npm//marked", + ], + entry_point = "angular_material/tools/markdown-to-html/transform-markdown.js", ) - - diff --git a/tools/markdown-to-html/index.bzl b/tools/markdown-to-html/index.bzl index c7dd99957d6..2b4daefc7f8 100644 --- a/tools/markdown-to-html/index.bzl +++ b/tools/markdown-to-html/index.bzl @@ -3,54 +3,56 @@ package path from the specified path. e.g. the path is "guides/test/my-text.md" and the label package is "guides/". The expected path would be "test/my-text.md". """ + def _relative_to_label(label, short_path): - return short_path[len(label.package) + 1:] + return short_path[len(label.package) + 1:] """ Implementation of the "markdown_to_html" rule. The implementation runs the transform executable in order to create the outputs for the specified source files. """ + def _markdown_to_html(ctx): - input_files = ctx.files.srcs; - args = ctx.actions.args() - expected_outputs = []; + input_files = ctx.files.srcs + args = ctx.actions.args() + expected_outputs = [] - # Do nothing if there are no input files. Bazel will throw if we schedule an action - # that returns no outputs. - if not input_files: - return None + # Do nothing if there are no input files. Bazel will throw if we schedule an action + # that returns no outputs. + if not input_files: + return None - # Add the bazel bin directory to the command arguments. The script needs to know about - # the output directory because the input files are not in the same location as the bazel - # bin directory. - args.add(ctx.bin_dir.path) + # Add the bazel bin directory to the command arguments. The script needs to know about + # the output directory because the input files are not in the same location as the bazel + # bin directory. + args.add(ctx.bin_dir.path) - for input_file in input_files: - # Determine the input file path relatively to the current package path. This is necessary - # because we want to preserve directories for the input files and `declare_file` expects a - # path that is relative to the current package. Also note that we should not use `.replace` - # here because the extension can be also in upper case. - relative_basepath = _relative_to_label(ctx.label, input_file.short_path)[:-len(".md")] + for input_file in input_files: + # Determine the input file path relatively to the current package path. This is necessary + # because we want to preserve directories for the input files and `declare_file` expects a + # path that is relative to the current package. Also note that we should not use `.replace` + # here because the extension can be also in upper case. + relative_basepath = _relative_to_label(ctx.label, input_file.short_path)[:-len(".md")] - # For each input file "xxx.md", we want to write an output file "xxx.html" - expected_outputs += [ctx.actions.declare_file("%s.html" % relative_basepath)] + # For each input file "xxx.md", we want to write an output file "xxx.html" + expected_outputs += [ctx.actions.declare_file("%s.html" % relative_basepath)] - # Add the input file to the command line arguments that will be passed to the - # transform-markdown executable. - args.add(input_file.path) + # Add the input file to the command line arguments that will be passed to the + # transform-markdown executable. + args.add(input_file.path) - # Run the transform markdown executable that transforms the specified source files. - # Note that we should specify the outputs here because Bazel can then throw an error - # if the script didn't generate the required outputs. - ctx.actions.run( - inputs = input_files, - executable = ctx.executable._transform_markdown, - outputs = expected_outputs, - arguments = [args], - progress_message = "MarkdownToHtml", - ) + # Run the transform markdown executable that transforms the specified source files. + # Note that we should specify the outputs here because Bazel can then throw an error + # if the script didn't generate the required outputs. + ctx.actions.run( + inputs = input_files, + executable = ctx.executable._transform_markdown, + outputs = expected_outputs, + arguments = [args], + progress_message = "MarkdownToHtml", + ) - return DefaultInfo(files = depset(expected_outputs)) + return DefaultInfo(files = depset(expected_outputs)) """ Rule definition for the "markdown_to_html" rule that can accept arbritary source files @@ -58,15 +60,16 @@ def _markdown_to_html(ctx): default output provider. """ markdown_to_html = rule( - implementation = _markdown_to_html, - attrs = { - "srcs": attr.label_list(allow_files = [".md"]), + implementation = _markdown_to_html, + attrs = { + "srcs": attr.label_list(allow_files = [".md"]), - # Executable for this rule that is responsible for converting the specified - # markdown files into HTML files. - "_transform_markdown": attr.label( - default = Label("//tools/markdown-to-html"), - executable = True, - cfg = "host" - )}, + # Executable for this rule that is responsible for converting the specified + # markdown files into HTML files. + "_transform_markdown": attr.label( + default = Label("//tools/markdown-to-html"), + executable = True, + cfg = "host", + ), + }, ) diff --git a/tools/package-docs-content/BUILD.bazel b/tools/package-docs-content/BUILD.bazel index 3c27861ec15..5f8710ea70a 100644 --- a/tools/package-docs-content/BUILD.bazel +++ b/tools/package-docs-content/BUILD.bazel @@ -4,16 +4,16 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") load("//tools:defaults.bzl", "ts_library") nodejs_binary( - name = "package-docs-content", - entry_point = "angular_material/tools/package-docs-content/package-docs-content.js", - data = [ - ":sources", - ], + name = "package-docs-content", + data = [ + ":sources", + ], + entry_point = "angular_material/tools/package-docs-content/package-docs-content.js", ) ts_library( - name = "sources", - srcs = glob(["**/*.ts"]), - deps = ["@npm//@types/node"], - tsconfig = ":tsconfig.json", + name = "sources", + srcs = glob(["**/*.ts"]), + tsconfig = ":tsconfig.json", + deps = ["@npm//@types/node"], ) diff --git a/tools/package-docs-content/index.bzl b/tools/package-docs-content/index.bzl index 1bf2ae5934d..1dbb3050c80 100644 --- a/tools/package-docs-content/index.bzl +++ b/tools/package-docs-content/index.bzl @@ -2,61 +2,63 @@ Implementation of the "package_docs_content" rule. The implementation runs the packager executable in order to group all specified files into the given sections. """ + def _package_docs_content(ctx): - # Directory that will contain all grouped input files. This directory will be created - # relatively to the current target package. (e.g. "bin/src/material-examples/docs-content") - output_dir = ctx.attr.name; + # Directory that will contain all grouped input files. This directory will be created + # relatively to the current target package. (e.g. "bin/src/material-examples/docs-content") + output_dir = ctx.attr.name - # Arguments that will be passed to the packager executable. - args = ctx.actions.args() + # Arguments that will be passed to the packager executable. + args = ctx.actions.args() - # List of outputs that should be generated by the packager action. Bazel will automatically - # throw an error if any output has not been generated properly. - expected_outputs = []; + # List of outputs that should be generated by the packager action. Bazel will automatically + # throw an error if any output has not been generated properly. + expected_outputs = [] - # Support passing arguments through a parameter file. This is necessary because on Windows - # there is an argument limit and we need to handle a large amount of input files. Bazel - # switches between parameter file and normal argument passing based on the operating system. - # Read more here: https://docs.bazel.build/versions/master/skylark/lib/Args.html#use_param_file - args.use_param_file(param_file_arg = "--param-file=%s") + # Support passing arguments through a parameter file. This is necessary because on Windows + # there is an argument limit and we need to handle a large amount of input files. Bazel + # switches between parameter file and normal argument passing based on the operating system. + # Read more here: https://docs.bazel.build/versions/master/skylark/lib/Args.html#use_param_file + args.use_param_file(param_file_arg = "--param-file=%s") - # Walk through each defined input target and the associated section and compute the - # output file which will be added to the executable arguments. - for input_target, section_name in ctx.attr.srcs.items(): - section_files = input_target.files.to_list() + # Walk through each defined input target and the associated section and compute the + # output file which will be added to the executable arguments. + for input_target, section_name in ctx.attr.srcs.items(): + section_files = input_target.files.to_list() - for input_file in section_files: - # For each input file, we want to create a copy that is stored in the output directory - # within its specified section. e.g. "pkg_bin/docs-content/guides/getting-started.html" - output_file = ctx.actions.declare_file( - "%s/%s/%s" % (output_dir, section_name, input_file.basename)) + for input_file in section_files: + # For each input file, we want to create a copy that is stored in the output directory + # within its specified section. e.g. "pkg_bin/docs-content/guides/getting-started.html" + output_file = ctx.actions.declare_file( + "%s/%s/%s" % (output_dir, section_name, input_file.basename), + ) - # Add the output file to the expected outputs so that Bazel throws an error if the file - # hasn't been generated properly. - expected_outputs += [output_file] + # Add the output file to the expected outputs so that Bazel throws an error if the file + # hasn't been generated properly. + expected_outputs += [output_file] - # Pass the input file path and the output file path to the packager executable. We need - # to do this for each file because we cannot determine the general path to the output - # directory in a reliable way because Bazel targets cannot just "declare" a directory. - # See: https://docs.bazel.build/versions/master/skylark/lib/actions.html - args.add("%s,%s" % (input_file.path, output_file.path)) + # Pass the input file path and the output file path to the packager executable. We need + # to do this for each file because we cannot determine the general path to the output + # directory in a reliable way because Bazel targets cannot just "declare" a directory. + # See: https://docs.bazel.build/versions/master/skylark/lib/actions.html + args.add("%s,%s" % (input_file.path, output_file.path)) - # Do nothing if there are no input files. Bazel will throw if we schedule an action - # that returns no outputs. - if not ctx.files.srcs: - return None + # Do nothing if there are no input files. Bazel will throw if we schedule an action + # that returns no outputs. + if not ctx.files.srcs: + return None - # Run the packager executable that groups the specified source files and writes them - # to the given output directory. - ctx.actions.run( - inputs = ctx.files.srcs, - executable = ctx.executable._packager, - outputs = expected_outputs, - arguments = [args], - progress_message = "PackageDocsContent", - ) + # Run the packager executable that groups the specified source files and writes them + # to the given output directory. + ctx.actions.run( + inputs = ctx.files.srcs, + executable = ctx.executable._packager, + outputs = expected_outputs, + arguments = [args], + progress_message = "PackageDocsContent", + ) - return DefaultInfo(files = depset(expected_outputs)) + return DefaultInfo(files = depset(expected_outputs)) """ Rule definition for the "package_docs_content" rule that can accept arbritary source files @@ -64,20 +66,21 @@ def _package_docs_content(ctx): content into a desired folder structure that can be shared with the docs application. """ package_docs_content = rule( - implementation = _package_docs_content, - attrs = { - # This defines the sources for the "package_docs_content" rule. Instead of just - # accepting a list of labels, this rule requires the developer to specify a label - # keyed dictionary. This allows developers to specify where specific targets - # should be grouped into. This helpful when publishing the docs content because - # the docs repository does not about the directory structure of the generated files. - "srcs": attr.label_keyed_string_dict(allow_files = True), + implementation = _package_docs_content, + attrs = { + # This defines the sources for the "package_docs_content" rule. Instead of just + # accepting a list of labels, this rule requires the developer to specify a label + # keyed dictionary. This allows developers to specify where specific targets + # should be grouped into. This helpful when publishing the docs content because + # the docs repository does not about the directory structure of the generated files. + "srcs": attr.label_keyed_string_dict(allow_files = True), - # Executable for this rule that is responsible for packaging the specified - # targets into the associated sections. - "_packager": attr.label( - default = Label("//tools/package-docs-content"), - executable = True, - cfg = "host" - )}, + # Executable for this rule that is responsible for packaging the specified + # targets into the associated sections. + "_packager": attr.label( + default = Label("//tools/package-docs-content"), + executable = True, + cfg = "host", + ), + }, ) diff --git a/tools/public_api_guard/BUILD.bazel b/tools/public_api_guard/BUILD.bazel index b29ba6b1998..7bddbb150ba 100644 --- a/tools/public_api_guard/BUILD.bazel +++ b/tools/public_api_guard/BUILD.bazel @@ -1,4 +1,4 @@ -package(default_visibility=["//visibility:public"]) +package(default_visibility = ["//visibility:public"]) load(":generate-guard-tests.bzl", "generate_test_targets") diff --git a/tools/public_api_guard/generate-guard-tests.bzl b/tools/public_api_guard/generate-guard-tests.bzl index 7a248f8c024..f82456f47a8 100644 --- a/tools/public_api_guard/generate-guard-tests.bzl +++ b/tools/public_api_guard/generate-guard-tests.bzl @@ -6,29 +6,29 @@ load("@npm_ts_api_guardian//:index.bzl", "ts_api_guardian_test") more maintainable, we allow passing a list of golden files that will be automatically verified against the associated source entry point. """ + def generate_test_targets(golden_files): - for golden_file in golden_files: - # Splits the path that is relative to the current directory into the package name and - # entry point tail path. The package name is always the first path segment (e.g. "cdk/") - [package_name, entry_point_tail] = golden_file.split("/", 1) + for golden_file in golden_files: + # Splits the path that is relative to the current directory into the package name and + # entry point tail path. The package name is always the first path segment (e.g. "cdk/") + [package_name, entry_point_tail] = golden_file.split("/", 1) - # Name of the entry-point (e.g. "a11y", "drag-drop", "platform") - entry_point = entry_point_tail[:-len(".d.ts")] + # Name of the entry-point (e.g. "a11y", "drag-drop", "platform") + entry_point = entry_point_tail[:-len(".d.ts")] - # Construct the path to the given entry-point. Note that we also need to find a way to - # allow guards for the primary entry-point of a package. e.g. "//src/cdk:cdk" should be also - # validated. We achieve this by checking if the package_name is equal to the entry_point name. - # For example: "public_api_guard/cdk/cdk.d.ts" will be the golden for the primary entry-point. - entry_point_path = "%s" % (package_name if entry_point == package_name - else "%s/%s" % (package_name, entry_point)) + # Construct the path to the given entry-point. Note that we also need to find a way to + # allow guards for the primary entry-point of a package. e.g. "//src/cdk:cdk" should be also + # validated. We achieve this by checking if the package_name is equal to the entry_point name. + # For example: "public_api_guard/cdk/cdk.d.ts" will be the golden for the primary entry-point. + entry_point_path = "%s" % (package_name if entry_point == package_name else "%s/%s" % (package_name, entry_point)) - # Create the test rule that compares the build output with the golden file. - ts_api_guardian_test( - name = "%s_api" % golden_file, - actual = "angular_material/src/%s/index.d.ts" % entry_point_path, - data = [golden_file] + [ - "//src/%s" % (entry_point_path), - ], - golden = "angular_material/tools/public_api_guard/%s" % golden_file, - use_angular_tag_rules = False, - ) + # Create the test rule that compares the build output with the golden file. + ts_api_guardian_test( + name = "%s_api" % golden_file, + actual = "angular_material/src/%s/index.d.ts" % entry_point_path, + data = [golden_file] + [ + "//src/%s" % (entry_point_path), + ], + golden = "angular_material/tools/public_api_guard/%s" % golden_file, + use_angular_tag_rules = False, + ) diff --git a/tools/sass_bundle.bzl b/tools/sass_bundle.bzl index d9607259d32..0752796a3ad 100644 --- a/tools/sass_bundle.bzl +++ b/tools/sass_bundle.bzl @@ -2,69 +2,70 @@ load("@io_bazel_rules_sass//:defs.bzl", "SassInfo") # Implementation of sass_bundle that performs an action def _sass_bundle(ctx): - # Define arguments that will be passed to the underlying nodejs script. - args = ctx.actions.args() + # Define arguments that will be passed to the underlying nodejs script. + args = ctx.actions.args() - # The entry-point scss file for the bundle. - args.add("--entry") - args.add(ctx.file.entry_point) + # The entry-point scss file for the bundle. + args.add("--entry") + args.add(ctx.file.entry_point) - # The list of files that can be included in the bundle. - args.add("--srcs") - args.add_joined(ctx.files.srcs, join_with = ",") + # The list of files that can be included in the bundle. + args.add("--srcs") + args.add_joined(ctx.files.srcs, join_with = ",") - # The generated bundle's filename. - args.add("--output") - args.add(ctx.outputs.output_name.path) + # The generated bundle's filename. + args.add("--output") + args.add(ctx.outputs.output_name.path) - # Define an "action" that will run the nodejs_binary executable. This is - # the main thing that sass_bundle rule does. - ctx.actions.run( - inputs = ctx.files.srcs + ctx.files.entry_point, - executable = ctx.executable._sass_bundle, - outputs = [ctx.outputs.output_name], - arguments = [args], - progress_message = "SassBundle (%s)" % ctx.attr.output_name, - ) + # Define an "action" that will run the nodejs_binary executable. This is + # the main thing that sass_bundle rule does. + ctx.actions.run( + inputs = ctx.files.srcs + ctx.files.entry_point, + executable = ctx.executable._sass_bundle, + outputs = [ctx.outputs.output_name], + arguments = [args], + progress_message = "SassBundle (%s)" % ctx.attr.output_name, + ) - output_depset = depset([ctx.outputs.output_name]) + output_depset = depset([ctx.outputs.output_name]) - # The return value describes what the rule is producing. In this case we need to specify - # the "DefaultInfo" and "SassInfo" provider so that the given rule target acts like a filegroup - # and can be also used as sass_library. - return [ - DefaultInfo(files = output_depset), - SassInfo(transitive_sources = output_depset), - ] + # The return value describes what the rule is producing. In this case we need to specify + # the "DefaultInfo" and "SassInfo" provider so that the given rule target acts like a filegroup + # and can be also used as sass_library. + return [ + DefaultInfo(files = output_depset), + SassInfo(transitive_sources = output_depset), + ] # Rule definition for sass_bundle that defines attributes and outputs. sass_bundle = rule( - # Point to the function that will execute for this rule. - implementation = _sass_bundle, + # Point to the function that will execute for this rule. + implementation = _sass_bundle, - # The attributes that can be set to this rule. - attrs = { - # The source files for this rule. This must include all sass files that - # *could* be included in the bundle, as only the files that this rule knows - # about (i.e. the labels) will be available in the bazel sandbox in which - # the nodejs_binary runs. - "srcs": attr.label_list(allow_files = True), + # The attributes that can be set to this rule. + attrs = { + # The source files for this rule. This must include all sass files that + # *could* be included in the bundle, as only the files that this rule knows + # about (i.e. the labels) will be available in the bazel sandbox in which + # the nodejs_binary runs. + "srcs": attr.label_list(allow_files = True), - # The name of the file to be output from this rule. The rule will fail if - # the nodejs_binary does not produce this output file. By using - # `attr.output()`, we can omit the separate `outputs` declaration a more - # complicated rule would need. - "output_name": attr.output(), + # The name of the file to be output from this rule. The rule will fail if + # the nodejs_binary does not produce this output file. By using + # `attr.output()`, we can omit the separate `outputs` declaration a more + # complicated rule would need. + "output_name": attr.output(), - # The scss entry-point. Note that this uses a label and not a string - # in order to make bazel aware that this file is a *dependency* of the - # rule (and will thus be available to the nodejs_binary in the sandbox). - "entry_point": attr.label(mandatory = True, allow_single_file = True), + # The scss entry-point. Note that this uses a label and not a string + # in order to make bazel aware that this file is a *dependency* of the + # rule (and will thus be available to the nodejs_binary in the sandbox). + "entry_point": attr.label(mandatory = True, allow_single_file = True), - # The executable (bundler) for this rule (private). - "_sass_bundle": attr.label( - default = Label("//tools:sass_bundle"), - executable = True, - cfg = "host" - )}, + # The executable (bundler) for this rule (private). + "_sass_bundle": attr.label( + default = Label("//tools:sass_bundle"), + executable = True, + cfg = "host", + ), + }, ) diff --git a/tools/sass_generate_binaries.bzl b/tools/sass_generate_binaries.bzl index 55f72cc096e..a1a6da591e0 100644 --- a/tools/sass_generate_binaries.bzl +++ b/tools/sass_generate_binaries.bzl @@ -4,14 +4,14 @@ load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") # All generated sass binaries will be exposed as a filegroup that has all the # CSS outputs from the specified source files. def sass_generate_binaries(filegroup_name, source_files, sass_deps = []): - for source_file in source_files: - sass_binary( - name = source_file.replace('.scss', '_scss'), - src = source_file, - deps = sass_deps, - ) + for source_file in source_files: + sass_binary( + name = source_file.replace(".scss", "_scss"), + src = source_file, + deps = sass_deps, + ) - native.filegroup( - name = filegroup_name, - srcs = [file.replace(".scss", "_scss") for file in source_files] - ) + native.filegroup( + name = filegroup_name, + srcs = [file.replace(".scss", "_scss") for file in source_files], + ) diff --git a/yarn.lock b/yarn.lock index ee20a40fd5b..924c489575d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -368,6 +368,30 @@ "@bazel/bazel-linux_x64" "0.24.1" "@bazel/bazel-win32_x64" "0.24.1" +"@bazel/buildifier-darwin_x64@0.25.1": + version "0.25.1" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.25.1.tgz#bcb8643ae46c6aa4f4981f59648ecd9087b30a11" + integrity sha512-9fD3tXYgSjpZCEUGFBadfwDw89b3z3acYLd8+a0F6Sb/9LB0jzXOCMzqFMA7m1b3wOh1ecgWOyT0TyPUDSLRkg== + +"@bazel/buildifier-linux_x64@0.25.1": + version "0.25.1" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-linux_x64/-/buildifier-linux_x64-0.25.1.tgz#50cc7c3b8f9dfa818ea6cc9f2ec761cbd39471ea" + integrity sha512-Wt2yA+yeimi6i0USHoE1T2EhRJwtKDBmDLQx2E8Q+QXysULLm4usMEIGPdQYbHqKyjL75jbwlwZTlm9EzdXgCg== + +"@bazel/buildifier-win32_x64@0.25.1": + version "0.25.1" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-win32_x64/-/buildifier-win32_x64-0.25.1.tgz#d990afed296f65675c1406ae36580473cab65f4c" + integrity sha512-ak91iv940z04NJfEhWHMSudjlZK5PrpDNL8k/cmYowi1JSfYvCchfABiXWxfWURmvqgSGE+KV72xxZ0HLU60bw== + +"@bazel/buildifier@^0.25.1": + version "0.25.1" + resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-0.25.1.tgz#e29ab77802d99d70a891b9a471f62e80030fc326" + integrity sha512-d3+DgsGmQ3cSLCm99321cl+vKD/c3pNSQINCBnipmNeNd7UA3/UQ2Ibp6MXZslF8fMQDpuLxhhCFUOnFAoNWsw== + optionalDependencies: + "@bazel/buildifier-darwin_x64" "0.25.1" + "@bazel/buildifier-linux_x64" "0.25.1" + "@bazel/buildifier-win32_x64" "0.25.1" + "@bazel/ibazel@^0.9.0": version "0.9.0" resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.9.0.tgz#fd60023acd36313d304cc2f8c2e181b88b5445cd"