build: update ngcontainer to bazel 0.18.0 (#26465) (#26488)

* build: update ngcontainer to bazel 0.18.0

* build: update skylint to bazel 0.18

use .bazelignore file to ignore node_modules directory

PR Close #26488
This commit is contained in:
Alex Eagle 2018-10-15 16:51:26 -07:00 committed by Igor Minar
parent 6468711e16
commit 30d6233e83
10 changed files with 19 additions and 29 deletions

1
.bazelignore Normal file
View File

@ -0,0 +1 @@
node_modules

View File

@ -57,6 +57,6 @@ test --experimental_ui
################################ ################################
# Temporary Settings for Ivy # # Temporary Settings for Ivy #
################################ ################################
# to determine if the compiler used should be Ivy or ViewEngine one can use `--define=compile=local` on # to determine if the compiler used should be Ivy or ViewEngine one can use `--define=compile=local` on
# any bazel target. This is a temporary flag until codebase is permanently switched to Ivy. # any bazel target. This is a temporary flag until codebase is permanently switched to Ivy.
build --define=compile=legacy build --define=compile=legacy

View File

@ -12,8 +12,8 @@
## IMPORTANT ## IMPORTANT
# If you change the `docker_image` version, also change the `cache_key` suffix and the version of # If you change the `docker_image` version, also change the `cache_key` suffix and the version of
# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file. # `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file.
var_1: &docker_image angular/ngcontainer:0.6.0 var_1: &docker_image angular/ngcontainer:0.7.0
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.6.0 var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.7.0
# Define common ENV vars # Define common ENV vars
var_3: &define_env_vars var_3: &define_env_vars

1
.gitignore vendored
View File

@ -14,7 +14,6 @@ pubspec.lock
.settings/ .settings/
*.swo *.swo
modules/.settings modules/.settings
.bazelrc
.vscode .vscode
modules/.vscode modules/.vscode

View File

@ -87,10 +87,10 @@ groups:
files: files:
include: include:
- "WORKSPACE" - "WORKSPACE"
- ".bazel*"
- "*.bazel" - "*.bazel"
- "*.bzl" - "*.bzl"
- "packages/bazel/*" - "packages/bazel/*"
- "tools/bazel.rc"
- "/docs/BAZEL.md" - "/docs/BAZEL.md"
users: users:
- alexeagle #primary - alexeagle #primary
@ -108,7 +108,6 @@ groups:
- "*.lock" - "*.lock"
- "tools/*" - "tools/*"
exclude: exclude:
- "tools/bazel.rc"
- "tools/public_api_guard/*" - "tools/public_api_guard/*"
- "aio/*" - "aio/*"
users: users:

View File

@ -1,7 +1,7 @@
workspace(name = "angular") workspace(name = "angular")
load( load(
"//packages/bazel:package.bzl", "//packages/bazel:package.bzl",
"rules_angular_dependencies", "rules_angular_dependencies",
"rules_angular_dev_dependencies", "rules_angular_dev_dependencies",
) )
@ -14,9 +14,11 @@ rules_angular_dev_dependencies()
# #
# Point Bazel to WORKSPACEs that live in subdirectories # Point Bazel to WORKSPACEs that live in subdirectories
# #
local_repository( http_archive(
name = "rxjs", name = "rxjs",
path = "node_modules/rxjs/src", url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
strip_prefix = "package/src",
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
) )
# Point to the integration test workspace just so that Bazel doesn't descend into it # Point to the integration test workspace just so that Bazel doesn't descend into it
@ -26,23 +28,12 @@ local_repository(
path = "integration/bazel", path = "integration/bazel",
) )
# Prevent Bazel from trying to build rxjs under angular devkit
# TODO(alexeagle): remove after Bazel 0.18 upgrade
local_repository(
name = "rxjs_ignore_nested_1",
path = "node_modules/@angular-devkit/core/node_modules/rxjs/src",
)
local_repository(
name = "rxjs_ignore_nested_2",
path = "node_modules/@angular-devkit/schematics/node_modules/rxjs/src",
)
# #
# Load and install our dependencies downloaded above. # Load and install our dependencies downloaded above.
# #
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install") load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
check_bazel_version("0.17.0", """ check_bazel_version("0.18.0", """
If you are on a Mac and using Homebrew, there is a breaking change to the installation in Bazel 0.16 If you are on a Mac and using Homebrew, there is a breaking change to the installation in Bazel 0.16
See https://blog.bazel.build/2018/08/22/bazel-homebrew.html See https://blog.bazel.build/2018/08/22/bazel-homebrew.html

View File

@ -72,7 +72,7 @@ keeps the outputs up-to-date as you save sources.
If you're experiencing problems with seemingly unrelated tests failing, it may be because you're not using the proper flags with your Bazel test runs in Angular. If you're experiencing problems with seemingly unrelated tests failing, it may be because you're not using the proper flags with your Bazel test runs in Angular.
See also: [`//tools/bazel.rc`](https://github.com/angular/angular/blob/master/tools/bazel.rc) where `--define=ivy=false` is defined as default. See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc) where `--define=ivy=false` is defined as default.
- `--config=debug`: build and launch in debug mode (see [debugging](#debugging) instructions below) - `--config=debug`: build and launch in debug mode (see [debugging](#debugging) instructions below)
- `--test_arg=--node_options=--inspect=9228`: change the inspector port. - `--test_arg=--node_options=--inspect=9228`: change the inspector port.
@ -165,7 +165,7 @@ You can see an overview at https://www.kchodorow.com/blog/2017/03/27/stamping-yo
In our repo, here is how it's configured: In our repo, here is how it's configured:
1) In `tools/bazel_stamp_vars.sh` we run the `git` commands to generate our versioning info. 1) In `tools/bazel_stamp_vars.sh` we run the `git` commands to generate our versioning info.
1) In `tools/bazel.rc` we register this script as the value for the `workspace_status_command` flag. Bazel will run the script when it needs to stamp a binary. 1) In `.bazelrc` we register this script as the value for the `workspace_status_command` flag. Bazel will run the script when it needs to stamp a binary.
Note that Bazel has a `--stamp` argument to `bazel build`, but this has no effect since our stamping takes place in Skylark rules. See https://github.com/bazelbuild/bazel/issues/1054 Note that Bazel has a `--stamp` argument to `bazel build`, but this has no effect since our stamping takes place in Skylark rules. See https://github.com/bazelbuild/bazel/issues/1054

View File

@ -83,9 +83,9 @@ def rules_angular_dev_dependencies():
# Fetching the Bazel source code allows us to compile the Skylark linter # Fetching the Bazel source code allows us to compile the Skylark linter
http_archive( http_archive(
name = "io_bazel", name = "io_bazel",
sha256 = "ace8cced3b21e64a8fdad68508e9b0644201ec848ad583651719841d567fc66d", sha256 = "978f7e0440dd82182563877e2e0b7c013b26b3368888b57837e9a0ae206fd396",
strip_prefix = "bazel-0.17.1", strip_prefix = "bazel-0.18.0",
url = "https://github.com/bazelbuild/bazel/archive/0.17.1.zip", url = "https://github.com/bazelbuild/bazel/archive/0.18.0.zip",
) )
# This commit matches the version of buildifier in angular/ngcontainer # This commit matches the version of buildifier in angular/ngcontainer

View File

@ -6,7 +6,7 @@ USER root
# Bazel install # Bazel install
# See https://bazel.build/versions/master/docs/install-ubuntu.html#using-bazel-custom-apt-repository-recommended # See https://bazel.build/versions/master/docs/install-ubuntu.html#using-bazel-custom-apt-repository-recommended
# Note, only the latest release is available, see https://github.com/bazelbuild/bazel/issues/4947 # Note, only the latest release is available, see https://github.com/bazelbuild/bazel/issues/4947
RUN BAZEL_VERSION="0.17.1" \ RUN BAZEL_VERSION="0.18.0" \
&& wget -q -O - https://bazel.build/bazel-release.pub.gpg | apt-key add - \ && wget -q -O - https://bazel.build/bazel-release.pub.gpg | apt-key add - \
&& echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list \ && echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list \
&& apt-get update \ && apt-get update \

View File

@ -6,7 +6,7 @@ This docker container provides everything needed to build and test Angular appli
- npm 6.2.0 - npm 6.2.0
- yarn 1.9.2 - yarn 1.9.2
- Java 8 (for Closure Compiler and Bazel) - Java 8 (for Closure Compiler and Bazel)
- Bazel build tool v0.17.1 - http://bazel.build - Bazel build tool v0.18.0 - http://bazel.build
- Google Chrome 69.0.3497.81 - Google Chrome 69.0.3497.81
- Mozilla Firefox 47.0.1 - Mozilla Firefox 47.0.1
- xvfb (virtual framebuffer) for headless testing - xvfb (virtual framebuffer) for headless testing