Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .circleci/base-rbe-bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ build:remote --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jd
build:remote --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
build:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build:remote --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.18.0/default:toolchain
build:remote --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.22.0/default:toolchain
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe for later: I like the approach in angular/angular of vendoring one file from the bazel team, the filename is versioned with Bazel so it's easy to treat it as a black box, then you just import that file to get all these settings

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, can be a future improvement.

build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# Platform flags:
# The toolchain container used for execution is defined in the target indicated
Expand All @@ -44,7 +44,7 @@ build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# "extra_toolchains" to be selected (given constraints defined in
# "exec_compatible_with").
# More about platforms: https://docs.bazel.build/versions/master/platforms.html
build:remote --extra_toolchains=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.18.0/cpp:cc-toolchain-clang-x86_64-default
build:remote --extra_toolchains=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.22.0/cpp:cc-toolchain-clang-x86_64-default
build:remote --extra_execution_platforms=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:rbe_ubuntu1604
build:remote --host_platform=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:rbe_ubuntu1604
build:remote --platforms=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:rbe_ubuntu1604
Expand Down Expand Up @@ -104,7 +104,7 @@ build:results-local --bes_results_url="https://source.cloud.google.com/results/i
# with the rbe-ubuntu16-04 container. Use of these flags is still experimental.
build:docker-sandbox --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
build:docker-sandbox --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
build:docker-sandbox --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.18.0/default:toolchain
build:docker-sandbox --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.22.0/default:toolchain
build:docker-sandbox --experimental_docker_image=gcr.io/cloud-marketplace/google/rbe-ubuntu16-04@sha256:9bd8ba020af33edb5f11eff0af2f63b3bcb168cd6566d7b27c6685e717787928
build:docker-sandbox --spawn_strategy=docker
build:docker-sandbox --strategy=Javac=docker
Expand All @@ -118,7 +118,6 @@ build:docker-sandbox --experimental_enable_docker_sandbox
# across machines, developers, and workspaces.
build:remote-cache --remote_cache=remotebuildexecution.googleapis.com
build:remote-cache --tls_enabled=true
build:remote-cache --experimental_strict_action_env=true
build:remote-cache --remote_timeout=3600
build:remote-cache --auth_enabled=true
build:remote-cache --spawn_strategy=standalone
Expand Down
2 changes: 1 addition & 1 deletion .circleci/bazel.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Save downloaded repositories in a location that can be cached by CircleCI. This helps us
# speeding up the analysis time significantly with Bazel managed node dependencies on the CI.
build --experimental_repository_cache=/home/circleci/bazel_repository_cache
build --repository_cache=/home/circleci/bazel_repository_cache

########################################
# Remote Build Execution support on CI #
Expand Down
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# To validate changes, use an online parser, eg.
# http://yaml-online-parser.appspot.com/

var_1: &docker_image angular/ngcontainer:0.7.0
var_1: &docker_image angular/ngcontainer:0.10.0
var_2: &cache_key v2-ng-mat-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}-0.7.0

# Settings common to each job
Expand Down Expand Up @@ -367,8 +367,10 @@ workflows:

integration_tests:
jobs:
- e2e_tests:
filters: *ignore_presubmit_branch_filter
# Temporarily disable e2e tests until https://github.com/angular/angular/issues/29123
# is resolved.
# - e2e_tests:
# filters: *ignore_presubmit_branch_filter
- prerender_build:
filters: *ignore_presubmit_branch_filter

Expand Down
135 changes: 56 additions & 79 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,77 +5,19 @@ 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",
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.16.5.zip",
strip_prefix = "rules_nodejs-0.16.5",
)

# Add TypeScript rules
http_archive(
name = "build_bazel_rules_typescript",
# Explicitly depend on https://github.com/bazelbuild/rules_typescript/pull/327 which fixes the devserver
# for windows. Once this has been reviewed and merged, we can switch back to a normal release.
url = "https://github.com/bazelbuild/rules_typescript/archive/2e761b53ca465a140c4a265cb80887e7bcf61eb9.zip",
strip_prefix = "rules_typescript-2e761b53ca465a140c4a265cb80887e7bcf61eb9",
)

# Add Angular source and Bazel rules.
http_archive(
name = "angular",
url = "https://github.com/angular/angular/archive/7.2.1.zip",
strip_prefix = "angular-7.2.1",
)

# 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.
# TODO(gmagolan): remove this once rxjs ships with an named UMD bundle and we
# are no longer building it from source.
http_archive(
name = "rxjs",
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
strip_prefix = "package/src",
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
)

# We need to create a local repository called "npm" because currently Angular Material
# stores all of it's NPM dependencies in the "@matdeps" repository. This is necessary because
# we don't want to reserve the "npm" repository that is commonly used by downstream projects.
# Since we still need the "npm" repository in order to use the Angular or TypeScript Bazel
# rules, we create a local repository that is just defined in **this** workspace and is not
# being shipped to downstream projects. This can be removed once downstream projects can
# consume Angular Material completely from NPM.
# TODO(devversion): remove once Angular Material can be consumed from NPM with Bazel.
local_repository(
name = "npm",
path = "tools/npm-workspace"
sha256 = "5c86b055c57e15bf32d9009a15bcd6d8e190c41b1ff2fb18037b75e0012e4e7c",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.26.0/rules_nodejs-0.26.0.tar.gz"],
)

# Add sass rules
http_archive(
name = "io_bazel_rules_sass",
sha256 = "f71709f4c2d39e81c9b452e00f22e554b26d7beacaedc5b85d61f771fd01268d",
url = "https://github.com/bazelbuild/rules_sass/archive/1.16.1.zip",
strip_prefix = "rules_sass-1.16.1",
)

# Since we are explitly fetching @build_bazel_rules_typescript, we should explicitly ask for
# its transitive dependencies in case those haven't been fetched yet.
load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
rules_typescript_dependencies()

# Since we are explitly fetching @build_bazel_rules_nodejs, we should explicitly ask for
# its transitive dependencies in case those haven't been fetched yet.
load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies")
rules_nodejs_dependencies()

# Fetch transitive dependencies which are needed by the Angular build targets.
load("@angular//packages/bazel:package.bzl", "rules_angular_dependencies")
rules_angular_dependencies()

# Fetch transitive dependencies which are needed to use the Sass rules.
load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies")
rules_sass_dependencies()

load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")

# The minimum bazel version to use with this repo is 0.18.0
check_bazel_version("0.18.0")
Expand All @@ -87,32 +29,67 @@ node_repositories(
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",
)

# 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("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_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()

# 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()

# Setup Angular workspace for building (Bazel managed node modules)
load("@angular//:index.bzl", "ng_setup_workspace")
ng_setup_workspace()
# 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("@angular_material//:index.bzl", "angular_material_setup_workspace")
angular_material_setup_workspace()
load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories")
browser_repositories()

# Setup Go toolchain (required for Bazel web testing rules)
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
# Temporarily add Angular sources and its dependencies to consume the ts_api_guardian,
# remote-build-execution, and protractor stuff.
# TODO(jelbourn): remove this once we can do all the same stuff via @npm//@angular
http_archive(
name = "angular",
sha256 = "a542f00adf5cafbcad24268d69da8e4746c22619699f29c3b3b0259d0ce52974",
url = "https://github.com/angular/angular/archive/8.0.0-beta.6.zip",
strip_prefix = "angular-8.0.0-beta.6",
)
load("@angular//packages/bazel:package.bzl", "rules_angular_dependencies")
rules_angular_dependencies()
load("@angular//:index.bzl", "ng_setup_workspace")
ng_setup_workspace()

# 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", "browser_repositories",
"web_test_repositories")

web_test_repositories()
browser_repositories(
chromium = True,
# Bring in bazel_toolchains for RBE stuff.
http_archive(
name = "bazel_toolchains",
sha256 = "109a99384f9d08f9e75136d218ebaebc68cc810c56897aea2224c57932052d30",
strip_prefix = "bazel-toolchains-94d31935a2c94fe7e7c7379a0f3393e181928ff7",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/94d31935a2c94fe7e7c7379a0f3393e181928ff7.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/94d31935a2c94fe7e7c7379a0f3393e181928ff7.tar.gz",
]
)
21 changes: 21 additions & 0 deletions angular-tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Workaround for https://github.com/angular/angular/issues/18810
// This file is required because when using the Angular NPM packages and building
// with AOT compilation, NGC needs the "ngsummary.json" files.
{
"compilerOptions": {
"lib": [
"dom",
"es2015"
],
"experimentalDecorators": true,
"types": []
},
"include": [
"node_modules/@angular/**/*"
],
"exclude": [
"node_modules/@angular/bazel/**",
"node_modules/@angular/compiler-cli/**",
"node_modules/@angular/**/testing/**"
]
}
12 changes: 6 additions & 6 deletions e2e/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package(default_visibility=["//visibility:public"])

load("@angular//:index.bzl", "protractor_web_test_suite")
load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite")
load("//tools:defaults.bzl", "ts_library")

ts_library(
name = "e2e_utils_lib",
srcs = glob(["util/**/*.ts"]),
tsconfig = ":tsconfig.json",
deps = [
"@matdeps//@types/jasmine",
"@matdeps//protractor"
"@npm//@types/jasmine",
"@npm//protractor"
]
)

Expand All @@ -20,8 +20,8 @@ ts_library(
srcs = [spec_file],
tsconfig = ":tsconfig.json",
deps = [
"@matdeps//@types/jasmine",
"@matdeps//protractor",
"@npm//@types/jasmine",
"@npm//protractor",
":e2e_utils_lib",
]
) for spec_file in glob(["components/**/*.spec.ts"])]
Expand All @@ -34,7 +34,7 @@ ts_library(
on_prepare = ":start-devserver.js",
server = "//src/e2e-app:devserver",
deps = [
"@matdeps//protractor",
"@npm//protractor",
":%s_specs_lib" % spec_file,
":e2e_utils_lib",
],
Expand Down
14 changes: 0 additions & 14 deletions index.bzl

This file was deleted.

39 changes: 21 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"node": ">= 5.4.1"
},
"scripts": {
"postinstall": "ngc -p angular-tsconfig.json",
"build": "gulp build-release-packages",
"dev-app": "gulp serve:devapp",
"test": "gulp test",
Expand All @@ -30,16 +31,16 @@
"version": "7.3.3",
"requiredAngularVersion": ">=7.0.0",
"dependencies": {
"@angular/animations": "^7.2.1",
"@angular/common": "^7.2.1",
"@angular/compiler": "^7.2.1",
"@angular/core": "^7.2.1",
"@angular/elements": "^7.2.1",
"@angular/forms": "^7.2.1",
"@angular/platform-browser": "^7.2.1",
"@angular/animations": "8.0.0-beta.6",
"@angular/common": "8.0.0-beta.6",
"@angular/compiler": "8.0.0-beta.6",
"@angular/core": "8.0.0-beta.6",
"@angular/elements": "8.0.0-beta.6",
"@angular/forms": "8.0.0-beta.6",
"@angular/platform-browser": "8.0.0-beta.6",
"@webcomponents/custom-elements": "^1.1.0",
"core-js": "^2.6.1",
"rxjs": "^6.3.3",
"rxjs": "^6.4.0",
"systemjs": "0.19.43",
"tsickle": "^0.34.0",
"tslib": "^1.9.3",
Expand All @@ -48,15 +49,17 @@
"devDependencies": {
"@angular-devkit/core": "7.1.2",
"@angular-devkit/schematics": "7.1.2",
"@angular/bazel": "^7.2.1",
"@angular/compiler-cli": "^7.2.1",
"@angular/http": "^7.2.1",
"@angular/platform-browser-dynamic": "^7.2.1",
"@angular/platform-server": "^7.2.1",
"@angular/router": "^7.2.1",
"@angular/bazel": "8.0.0-beta.6",
"@angular/compiler-cli": "8.0.0-beta.6",
"@angular/http": "8.0.0-beta.6",
"@angular/platform-browser-dynamic": "8.0.0-beta.6",
"@angular/platform-server": "8.0.0-beta.6",
"@angular/router": "8.0.0-beta.6",
"@angular/upgrade": "8.0.0-beta.6",
"@bazel/ibazel": "^0.9.0",
"@bazel/karma": "0.22.1",
"@bazel/typescript": "0.22.1",
"@bazel/jasmine": "0.26.0",
"@bazel/karma": "0.26.0",
"@bazel/typescript": "0.26.0",
"@firebase/app-types": "^0.3.2",
"@octokit/rest": "^15.9.4",
"@schematics/angular": "7.1.2",
Expand All @@ -83,8 +86,8 @@
"clang-format": "^1.2.4",
"codelyzer": "^4.5.0",
"conventional-changelog": "^3.0.5",
"dgeni": "^0.4.10",
"dgeni-packages": "^0.27.0",
"dgeni": "^0.4.11",
"dgeni-packages": "^0.27.1",
"firebase-tools": "^4.1.0",
"fs-extra": "^3.0.1",
"glob": "^7.1.2",
Expand Down
Loading