mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: build cdk with angular from source (#13541)
* build: build cdk with angular from source * Continues the long-term Bazel goal by fixing the CDK bazel build targets. Also builds the CDK targets with Angular from source. Follow up's will try to make serving, and testing possible. * Build package on CI * No longer compile with AOT compiler that generates factory files that cannot be packaged into "ng_package"
This commit is contained in:
committed by
Andrew Seguin
parent
a2c23a45be
commit
282736f8be
@@ -48,6 +48,7 @@ jobs:
|
||||
- run: sudo cp ./.circleci/bazel.rc /etc/bazel.bazelrc
|
||||
|
||||
# TODO(jelbourn): Update this command to run all tests if the Bazel issues have been fixed.
|
||||
- run: bazel build src/cdk:npm_package
|
||||
- run: bazel test src/{cdk,lib}/schematics:unit_tests
|
||||
|
||||
- save_cache:
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
# TODO(jelbourn): figure out if these workarounds are still needed
|
||||
|
||||
# TODO: Replace with fine-grained node_modules using `npm_install` / `yarn_install`.
|
||||
# TODO: See https://github.com/bazelbuild/rules_nodejs/wiki#migrating-to-rules_nodejs-013
|
||||
alias(
|
||||
name = "node_modules",
|
||||
actual = "@npm//:node_modules",
|
||||
)
|
||||
|
||||
# Glob pattern that matches all Angular testing bundles.
|
||||
ANGULAR_TESTING = [
|
||||
"node_modules/@angular/*/bundles/*-testing.umd.js",
|
||||
|
||||
@@ -3,17 +3,17 @@ workspace(name = "angular_material")
|
||||
# Add NodeJS rules (explicitly used for sass bundle rules)
|
||||
http_archive(
|
||||
name = "build_bazel_rules_nodejs",
|
||||
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.14.2.zip",
|
||||
strip_prefix = "rules_nodejs-0.14.2",
|
||||
sha256 = "af481421c9e74f754a693a8bf5e9409484e38cf7be6f73f85879bdc7ed1b1d82",
|
||||
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.15.0.zip",
|
||||
strip_prefix = "rules_nodejs-0.15.0",
|
||||
sha256 = "5f5b6464ca20aa63d278caaf4736f0381eb838800d7375132057a48f09d0b837",
|
||||
)
|
||||
|
||||
# Add TypeScript rules
|
||||
http_archive(
|
||||
name = "build_bazel_rules_typescript",
|
||||
url = "https://github.com/bazelbuild/rules_typescript/archive/0.19.1.zip",
|
||||
strip_prefix = "rules_typescript-0.19.1",
|
||||
sha256 = "91a03623a03a463ffd62cea3f7a384c2f298af6438d5d153fc4d69aa5665b53d",
|
||||
url = "https://github.com/bazelbuild/rules_typescript/archive/0.20.2.zip",
|
||||
strip_prefix = "rules_typescript-0.20.2",
|
||||
sha256 = "2879fbd7168ba5d17db22bc2f585c0d1d3a82dd5e6f8af118e8b2f74d290024e",
|
||||
)
|
||||
|
||||
# Fetch transient dependencies of the TypeScript bazel rules.
|
||||
@@ -31,6 +31,27 @@ http_archive(
|
||||
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
|
||||
sass_repositories()
|
||||
|
||||
# Add Angular source and Bazel rules.
|
||||
http_archive(
|
||||
name = "angular",
|
||||
# Temporarily locked down to the angular/angular:bazel branch. This branch includes necessary
|
||||
# commits that make building from source possible.
|
||||
# TODO(devversion): switch to release archive if workaround can be removed
|
||||
url = "https://github.com/angular/angular/archive/08e4489cf5a93a352954f1639da5e92112993753.zip",
|
||||
strip_prefix = "angular-08e4489cf5a93a352954f1639da5e92112993753",
|
||||
sha256 = "a59c85426048cc95f51937d0c26f4d1143b7bef730152b68ac4b79d1438e746b",
|
||||
)
|
||||
|
||||
# Add RxJS as repository because those are needed in order to build Angular from source.
|
||||
# Also we cannot refer to the RxJS version from the node modules because self-managed
|
||||
# node modules are not guaranteed to be installed.
|
||||
http_archive(
|
||||
name = "rxjs",
|
||||
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
|
||||
strip_prefix = "package/src",
|
||||
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
|
||||
)
|
||||
|
||||
# NOTE: this rule installs nodejs, npm, and yarn, but does NOT install
|
||||
# your npm dependencies. You must still run the package manager.
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install")
|
||||
@@ -54,14 +75,10 @@ yarn_install(
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
|
||||
ts_setup_workspace()
|
||||
|
||||
# Add Angular rules
|
||||
local_repository(
|
||||
name = "angular",
|
||||
path = "node_modules/@angular/bazel",
|
||||
)
|
||||
# Setup Angular bazel rules
|
||||
load("@angular//packages/bazel:package.bzl", "rules_angular_dependencies")
|
||||
rules_angular_dependencies()
|
||||
|
||||
# Add rxjs
|
||||
local_repository(
|
||||
name = "rxjs",
|
||||
path = "node_modules/rxjs/src",
|
||||
)
|
||||
# Setup Angular workspace for building (Bazel managed node modules)
|
||||
load("@angular//:index.bzl", "ng_setup_workspace")
|
||||
ng_setup_workspace()
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
"devDependencies": {
|
||||
"@angular-devkit/core": "7.0.0-rc.1",
|
||||
"@angular-devkit/schematics": "7.0.0-rc.1",
|
||||
"@angular/bazel": "7.0.0-rc.0",
|
||||
"@angular/compiler-cli": "7.0.0-rc.0",
|
||||
"@angular/http": "7.0.0-rc.0",
|
||||
"@angular/platform-browser-dynamic": "7.0.0-rc.0",
|
||||
|
||||
+7
-4
@@ -1,18 +1,21 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
load("@angular//:index.bzl", "ng_package")
|
||||
load("//:packages.bzl", "CDK_TARGETS", "ROLLUP_GLOBALS", "VERSION_PLACEHOLDER_REPLACEMENTS")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
# Export the CDK tsconfig so that subpackages can reference it directly.
|
||||
exports_files(["tsconfig-build.json"])
|
||||
|
||||
# Root "@angular/cdk" entry-point that does not re-export individual entry-points.
|
||||
ts_library(
|
||||
ng_module(
|
||||
name = "cdk",
|
||||
srcs = glob(["*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk",
|
||||
deps = [],
|
||||
tsconfig = "//src/lib:tsconfig-build.json",
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
],
|
||||
tsconfig = ":tsconfig-build.json",
|
||||
)
|
||||
|
||||
# Creates the @angular/cdk package published to npm.
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "a11y",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/a11y",
|
||||
deps = [
|
||||
"@angular//packages/common",
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/coercion",
|
||||
"//src/cdk/keycodes",
|
||||
"//src/cdk/observers",
|
||||
"//src/cdk/platform",
|
||||
"@rxjs",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "accordion",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/accordion",
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"//src/cdk/coercion",
|
||||
"//src/cdk/collections",
|
||||
"@rxjs",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "bidi",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/bidi",
|
||||
deps = ["@rxjs"],
|
||||
deps = [
|
||||
"@angular//packages/common",
|
||||
"@angular//packages/core",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -15,10 +18,7 @@ ts_library(
|
||||
name = "bidi_test_sources",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.spec.ts"]),
|
||||
deps = [
|
||||
":bidi",
|
||||
"@rxjs",
|
||||
],
|
||||
deps = [":bidi"],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
|
||||
ng_module(
|
||||
ts_library(
|
||||
name = "coercion",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/coercion",
|
||||
deps = ["@rxjs"],
|
||||
deps = ["@npm//tslib"],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "collections",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/collections",
|
||||
deps = ["@rxjs"],
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
"@rxjs"
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
|
||||
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "drag-drop",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/drag-drop",
|
||||
deps = [
|
||||
"@angular//packages/common",
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/platform",
|
||||
"//src/cdk/overlay",
|
||||
"//src/cdk/bidi",
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
|
||||
ng_module(
|
||||
ts_library(
|
||||
name = "keycodes",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/keycodes",
|
||||
deps = ["@rxjs"],
|
||||
deps = ["@npm//tslib"],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "layout",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/layout",
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/coercion",
|
||||
"//src/cdk/platform",
|
||||
"@rxjs",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "observers",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/observers",
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/coercion",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "overlay",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/overlay",
|
||||
deps = [
|
||||
"@angular//packages/common",
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/bidi",
|
||||
"//src/cdk/coercion",
|
||||
"//src/cdk/keycodes",
|
||||
"//src/cdk/platform",
|
||||
"//src/cdk/portal",
|
||||
"//src/cdk/scrolling",
|
||||
"@rxjs",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "platform",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/platform",
|
||||
deps = ["@rxjs"],
|
||||
deps = [
|
||||
"@angular//packages/common",
|
||||
"@angular//packages/core",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "portal",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/portal",
|
||||
deps = ["@rxjs"],
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -15,10 +17,7 @@ ts_library(
|
||||
name = "portal_test_sources",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.spec.ts"]),
|
||||
deps = [
|
||||
":portal",
|
||||
"@rxjs",
|
||||
],
|
||||
deps = [":portal"],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
|
||||
@@ -19,16 +19,16 @@ ts_library(
|
||||
srcs = glob(["**/*.ts"], exclude=["**/files/**/*.ts", "**/*.spec.ts"]),
|
||||
tsconfig = ":tsconfig.json",
|
||||
deps = [
|
||||
"@npm//:@schematics/angular",
|
||||
"@npm//:@angular-devkit/schematics",
|
||||
"@npm//@schematics/angular",
|
||||
"@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//:rxjs",
|
||||
"@npm//:tslint",
|
||||
"@npm//:typescript"
|
||||
"@npm//@types/jasmine",
|
||||
"@npm//@types/node",
|
||||
"@npm//glob",
|
||||
"@npm//parse5",
|
||||
"@npm//rxjs",
|
||||
"@npm//tslint",
|
||||
"@npm//typescript"
|
||||
],
|
||||
)
|
||||
|
||||
@@ -53,13 +53,13 @@ ts_library(
|
||||
srcs = glob(["**/*.spec.ts"], exclude = ["**/files/**/*.spec.ts"]),
|
||||
deps = [
|
||||
":schematics",
|
||||
"@npm//:@schematics/angular",
|
||||
"@npm//:@angular-devkit/schematics",
|
||||
"@npm//:@types/jasmine",
|
||||
"@npm//:@types/node",
|
||||
"@npm//:mock-fs",
|
||||
"@npm//:tslint",
|
||||
"@npm//:typescript",
|
||||
"@npm//@schematics/angular",
|
||||
"@npm//@angular-devkit/schematics",
|
||||
"@npm//@types/jasmine",
|
||||
"@npm//@types/node",
|
||||
"@npm//mock-fs",
|
||||
"@npm//tslint",
|
||||
"@npm//typescript",
|
||||
],
|
||||
tsconfig = ":tsconfig.json",
|
||||
testonly = True,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
|
||||
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "scrolling",
|
||||
@@ -10,11 +10,13 @@ ng_module(
|
||||
module_name = "@angular/cdk/scrolling",
|
||||
assets = [":virtual-scroll-viewport.css"] + glob(["**/*.html"]),
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/bidi",
|
||||
"//src/cdk/coercion",
|
||||
"//src/cdk/collections",
|
||||
"//src/cdk/platform",
|
||||
"@rxjs",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "stepper",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/stepper",
|
||||
deps = [
|
||||
"@angular//packages/common",
|
||||
"@angular//packages/core",
|
||||
"@angular//packages/forms",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/a11y",
|
||||
"//src/cdk/bidi",
|
||||
"//src/cdk/coercion",
|
||||
"//src/cdk/keycodes",
|
||||
"@rxjs",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "table",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/table",
|
||||
deps = [
|
||||
"@angular//packages/common",
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/bidi",
|
||||
"//src/cdk/collections",
|
||||
"//src/cdk/coercion",
|
||||
"//src/cdk/platform",
|
||||
"@rxjs",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "testing",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/testing",
|
||||
tsconfig = ":tsconfig-test.json",
|
||||
deps = ["@rxjs"],
|
||||
tsconfig = ":tsconfig-bazel.json",
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// This file exists to be consumed by bazel
|
||||
// This file exists to be consumed by Bazel
|
||||
// Note that there is no build tsconfig because the cdk/testing entry-point is internal-only.
|
||||
{
|
||||
"extends": "../tsconfig-build",
|
||||
"files": [
|
||||
@@ -1,13 +1,16 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "text-field",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/text-field",
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/coercion",
|
||||
"//src/cdk/platform",
|
||||
],
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "tree",
|
||||
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
|
||||
module_name = "@angular/cdk/tree",
|
||||
deps = [
|
||||
"@angular//packages/common",
|
||||
"@angular//packages/core",
|
||||
"@rxjs",
|
||||
"@rxjs//operators",
|
||||
"//src/cdk/a11y",
|
||||
"//src/cdk/bidi",
|
||||
"//src/cdk/coercion",
|
||||
"//src/cdk/collections",
|
||||
"@rxjs",
|
||||
],
|
||||
tsconfig = "//src/cdk:tsconfig-build.json",
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"target": "es2015",
|
||||
"lib": ["es2015", "dom"],
|
||||
"skipLibCheck": true,
|
||||
"types": ["jasmine", "tslib"],
|
||||
"types": ["tslib"],
|
||||
"paths": {
|
||||
"@angular/cdk/*": ["../../dist/packages/cdk/*"]
|
||||
}
|
||||
|
||||
@@ -20,14 +20,14 @@ ts_library(
|
||||
]),
|
||||
deps = [
|
||||
"//src/cdk/schematics",
|
||||
"@npm//:@angular-devkit/schematics",
|
||||
"@npm//:@schematics/angular",
|
||||
"@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//:parse5",
|
||||
"@npm//:tslint",
|
||||
"@npm//:typescript",
|
||||
"@npm//@types/jasmine",
|
||||
"@npm//@types/node",
|
||||
"@npm//parse5",
|
||||
"@npm//tslint",
|
||||
"@npm//typescript",
|
||||
],
|
||||
tsconfig = ":tsconfig.json",
|
||||
)
|
||||
@@ -54,11 +54,11 @@ ts_library(
|
||||
deps = [
|
||||
":schematics",
|
||||
"//src/cdk/schematics",
|
||||
"@npm//:@schematics/angular",
|
||||
"@npm//:@angular-devkit/schematics",
|
||||
"@npm//:@types/jasmine",
|
||||
"@npm//:@types/node",
|
||||
"@npm//:fs-extra",
|
||||
"@npm//@schematics/angular",
|
||||
"@npm//@angular-devkit/schematics",
|
||||
"@npm//@types/jasmine",
|
||||
"@npm//@types/node",
|
||||
"@npm//fs-extra",
|
||||
],
|
||||
tsconfig = ":tsconfig.json",
|
||||
testonly = True,
|
||||
|
||||
+8
-1
@@ -6,12 +6,19 @@ 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",
|
||||
)
|
||||
|
||||
# Executable for the custom sass_bundle rule (see sass_bundle.bzl).
|
||||
nodejs_binary(
|
||||
name = "sass_bundle",
|
||||
data = [":sass_bundle_lib"],
|
||||
data = [
|
||||
"@npm//scss-bundle",
|
||||
":sass_bundle_lib",
|
||||
],
|
||||
entry_point = "angular_material/tools/sass_bundle.js",
|
||||
)
|
||||
|
||||
@@ -46,3 +46,7 @@ build --workspace_status_command=./tools/bazel-stamp-vars.sh
|
||||
# Make TypeScript and Angular compilation fast, by keeping a few copies of the compiler
|
||||
# running as daemons, and cache SourceFile AST's to reduce parse time.
|
||||
build --strategy=TypeScriptCompile=worker --strategy=AngularTemplateCompile=worker
|
||||
|
||||
# Use the new "ngtsc" compiler strategy. We don't want to compile with Ivy nor with the
|
||||
# legacy compiler that doesn't handle `providedIn` properly.
|
||||
build --define=compile=local
|
||||
|
||||
+19
-2
@@ -1,12 +1,29 @@
|
||||
# Re-export of Bazel rules with repository-wide defaults
|
||||
|
||||
load("@angular//:index.bzl", _ng_module = "ng_module")
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", _jasmine_node_test = "jasmine_node_test")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library")
|
||||
|
||||
def ts_library(deps = [], **kwargs):
|
||||
ts_library(**kwargs)
|
||||
|
||||
def ng_module(deps = [], **kwargs):
|
||||
local_deps = [
|
||||
# Since we use the TypeScript import helpers (tslib) for each TypeScript configuration,
|
||||
# we declare TSLib as default dependency
|
||||
"@npm//tslib",
|
||||
] + deps
|
||||
|
||||
_ng_module(
|
||||
deps = local_deps,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
def jasmine_node_test(deps = [], **kwargs):
|
||||
local_deps = [
|
||||
# Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/344
|
||||
"@npm//:jasmine",
|
||||
"@npm//:source-map-support",
|
||||
"@npm//jasmine",
|
||||
"@npm//source-map-support",
|
||||
] + deps
|
||||
|
||||
_jasmine_node_test(
|
||||
|
||||
@@ -28,15 +28,6 @@
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/bazel@7.0.0-rc.0":
|
||||
version "7.0.0-rc.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-7.0.0-rc.0.tgz#3d624c7a2c9ec9a2a00a8cdbb6d1d1137f94fdf8"
|
||||
integrity sha512-yO9y1Fvveenlp3MYQglfAwFJObA0RZTO1JQEYzh4OVDifw67pGMR0c9tED5U1Gh0HxTjzxn5zVlqLwQbCgTJAw==
|
||||
dependencies:
|
||||
"@bazel/typescript" "^0.15.0"
|
||||
"@types/node" "6.0.84"
|
||||
protobufjs "5.0.0"
|
||||
|
||||
"@angular/common@7.0.0-rc.0":
|
||||
version "7.0.0-rc.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/common/-/common-7.0.0-rc.0.tgz#4872a430838653cbddfba759ccf1f9332c065171"
|
||||
@@ -254,15 +245,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.3.1.tgz#5f02f208f138e581bbdb1534d5c013d7a0ac9799"
|
||||
integrity sha1-XwLyCPE45YG72xU01cAT16Csl5k=
|
||||
|
||||
"@bazel/typescript@^0.15.0":
|
||||
version "0.15.3"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.15.3.tgz#5c32b3bf664b268f9ffb634b86f40004a50e7ef9"
|
||||
integrity sha512-YWKX1cLGjWx2OdYBU0WeV7DlemlEaXuMcPKkeB3p2D7jiso5YYHaaOevWOQVJXKS4E/fbjd8nw7RGtRWsX8Myg==
|
||||
dependencies:
|
||||
protobufjs "5.0.0"
|
||||
tsickle "0.25.x"
|
||||
tsutils "2.20.0"
|
||||
|
||||
"@bazel/typescript@^0.19.1":
|
||||
version "0.19.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.19.1.tgz#61dd57c0ab8a6c9930d2463d44e9522ec007fe3a"
|
||||
@@ -761,11 +743,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.11.4.tgz#e8bd933c3f78795d580ae41d86590bfc1f4f389d"
|
||||
integrity sha512-ojnbBiKkZFYRfQpmtnnWTMw+rzGp/JiystjluW9jgN3VzRwilXddJ6aGQ9V/7iuDG06SBgn7ozW9k3zcAnYjYQ==
|
||||
|
||||
"@types/node@6.0.84":
|
||||
version "6.0.84"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.84.tgz#193ffe5a9f42864d425ffd9739d95b753c6a1eab"
|
||||
integrity sha512-1SvEazClhUBRNroJM3oB3xf3u2r6xGmHDGbdigqNPHvNKLl8/BtATgO9eC04ZLuovpSh0B20BF1QJxdi+qmTlg==
|
||||
|
||||
"@types/node@^6.0.46":
|
||||
version "6.0.118"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.118.tgz#8014a9b1dee0b72b4d7cd142563f1af21241c3a2"
|
||||
@@ -9728,7 +9705,7 @@ source-map-support@0.5.9, source-map-support@^0.5.0, source-map-support@^0.5.9:
|
||||
buffer-from "^1.0.0"
|
||||
source-map "^0.6.0"
|
||||
|
||||
source-map-support@^0.4.0, source-map-support@^0.4.15, source-map-support@^0.4.2, source-map-support@~0.4.0:
|
||||
source-map-support@^0.4.0, source-map-support@^0.4.15, source-map-support@~0.4.0:
|
||||
version "0.4.18"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f"
|
||||
integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==
|
||||
@@ -10600,16 +10577,6 @@ tsconfig@^6.0.0:
|
||||
strip-bom "^3.0.0"
|
||||
strip-json-comments "^2.0.0"
|
||||
|
||||
tsickle@0.25.x:
|
||||
version "0.25.6"
|
||||
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.25.6.tgz#b595db16b236721824eeeda8bb262365b47ef334"
|
||||
integrity sha1-tZXbFrI2chgk7u2ouyYjZbR+8zQ=
|
||||
dependencies:
|
||||
minimist "^1.2.0"
|
||||
mkdirp "^0.5.1"
|
||||
source-map "^0.5.6"
|
||||
source-map-support "^0.4.2"
|
||||
|
||||
tsickle@0.28.0:
|
||||
version "0.28.0"
|
||||
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875"
|
||||
@@ -10659,13 +10626,6 @@ tslint@^5.11.0:
|
||||
tslib "^1.8.0"
|
||||
tsutils "^2.27.2"
|
||||
|
||||
tsutils@2.20.0:
|
||||
version "2.20.0"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3"
|
||||
integrity sha512-qPOBy1/hwLdBxh/TNIpim5qL1WRMR0tgVGBB6shjnpw6/SuS5ZKYyXXxKDYsMsMtVdFOcL+XPGZVEuc+eCOo4A==
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
tsutils@2.27.2:
|
||||
version "2.27.2"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7"
|
||||
|
||||
Reference in New Issue
Block a user