Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

build: upgrade to Angular v9 and switch to Bazel #113

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
72 changes: 72 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
###############################
# Filesystem interactions #
###############################

# Don't create bazel-* symlinks in the WORKSPACE directory.
# These require .gitignore and may scare users. Also, it's a workaround for
# https://github.com/bazelbuild/rules_typescript/issues/12 which affects the common case of
# having `tsconfig.json` in the WORKSPACE directory. Instead, you should run
# `bazel info output_base` to find out where the outputs went.
build --symlink_prefix=/

# Performance: avoid stat'ing input files
build --watchfs

# Turn off legacy external runfiles
build --nolegacy_external_runfiles
run --nolegacy_external_runfiles
test --nolegacy_external_runfiles

# This flag is needed to so that the bazel cache is not invalidated
# when running bazel via `yarn bazel`.
build --incompatible_strict_action_env

# Do not build runfile forests by default. If an execution strategy relies on runfile
# forests, the forest is created on-demand. See: https://github.com/bazelbuild/bazel/issues/6627
# and https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df
build --nobuild_runfile_links

###############################
# Output control #
###############################

# A more useful default output mode for bazel query
# Prints eg. "ng_module rule //foo:bar" rather than just "//foo:bar"
query --output=label_kind

# By default, failing tests don't print any output, it goes to the log file
test --test_output=errors

#################################
# Release configuration. #
# Run with "--config=release" #
#################################

# Configures script to do version stamping.
# See https://docs.bazel.build/versions/master/user-manual.html#flag--workspace_status_command
build:release --workspace_status_command="node ./tools/bazel-stamp-vars.js"
build:release --stamp

################################
# View Engine / Ivy toggle #
################################
build:view-engine --define=angular_ivy_enabled=False
build:ivy --define=angular_ivy_enabled=True

# Set Ivy as the default
build --config=ivy

################################
# --config=debug #
################################

# Enable debugging tests with --config=debug
test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results

################################
# Local Environment Setup #
# Needs to be last statement #
################################
# Load any settings which are specific to the current user. Needs to be *last* statement
# in this config, as the user configuration should be able to overwrite flags from this file.
try-import .bazelrc.user
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.0
19 changes: 19 additions & 0 deletions .circleci/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Bazel configuration that will be copied to /etc/bazel.bazelrc in CircleCI containers.
# This allows us adding specific configuration flags for builds within CircleCI.
# See more: https://docs.bazel.build/versions/master/user-manual.html#where-are-the-bazelrc-files

# Print all enabled Bazel flags in CI mode. This makes it easier to debug and reproduce
# Bazel issues that show up on CircleCI.
common --announce_rc

# 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 --repository_cache=/home/circleci/bazel_repository_cache

# Workaround https://github.com/bazelbuild/bazel/issues/3645. Bazel doesn't calculate the
# memory ceiling correctly when running under Docker. Limit Bazel to consuming resources that
# fit in CircleCI "xlarge" class. https://circleci.com/docs/2.0/configuration-reference/#resource_class
# Note that we use less than the available RAM as bazel only estimates memory for actions
# and we don't want to accidentally run out of memory.
build --local_ram_resources=14336
build --local_cpu_resources=8
Loading