2018-11-28 18:34:27 -05:00
|
|
|
# Load any settings specific to the current user
|
|
|
|
try-import .bazelrc.user
|
|
|
|
################################
|
|
|
|
# Settings for Angular team members only
|
|
|
|
################################
|
|
|
|
# To enable this feature check the "Remote caching" section in docs/BAZEL.md.
|
|
|
|
build:angular-team --remote_http_cache=https://storage.googleapis.com/angular-team-cache
|
|
|
|
|
2017-11-02 15:15:47 -04:00
|
|
|
###############################
|
|
|
|
# Typescript / Angular / Sass #
|
|
|
|
###############################
|
|
|
|
|
|
|
|
# Make compilation fast, by keeping a few copies of the compilers
|
|
|
|
# running as daemons, and cache SourceFile AST's to reduce parse time.
|
|
|
|
build --strategy=TypeScriptCompile=worker
|
|
|
|
build --strategy=AngularTemplateCompile=worker
|
|
|
|
|
2017-12-06 09:56:49 -05:00
|
|
|
# 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
|
|
|
|
|
2017-11-02 15:15:47 -04:00
|
|
|
###############################
|
|
|
|
# Filesystem interactions #
|
|
|
|
###############################
|
|
|
|
|
2018-02-22 12:47:09 -05:00
|
|
|
# Don't create symlinks like bazel-out in the project.
|
|
|
|
# These cause VSCode to traverse a massive tree, opening file handles and
|
|
|
|
# eventually a surprising failure with auto-discovery of the C++ toolchain in
|
|
|
|
# MacOS High Sierra.
|
|
|
|
# See https://github.com/bazelbuild/bazel/issues/4603
|
|
|
|
build --symlink_prefix=/
|
2017-11-02 15:15:47 -04:00
|
|
|
|
|
|
|
# Performance: avoid stat'ing input files
|
|
|
|
build --watchfs
|
|
|
|
|
2018-10-25 20:02:50 -04:00
|
|
|
# Turn off legacy external runfiles
|
|
|
|
run --nolegacy_external_runfiles
|
|
|
|
test --nolegacy_external_runfiles
|
|
|
|
|
2018-02-13 11:20:35 -05:00
|
|
|
###############################
|
|
|
|
# Release support #
|
2018-11-29 20:10:29 -05:00
|
|
|
# Turn on these settings with #
|
|
|
|
# --config=release #
|
2018-02-13 11:20:35 -05:00
|
|
|
###############################
|
|
|
|
|
2018-03-15 18:36:11 -04:00
|
|
|
# Releases should always be stamped with version control info
|
2018-12-03 14:43:21 -05:00
|
|
|
# This command assumes node on the path and is a workaround for
|
|
|
|
# https://github.com/bazelbuild/bazel/issues/4802
|
|
|
|
build:release --workspace_status_command="node ./tools/bazel_stamp_vars.js"
|
2018-02-13 11:20:35 -05:00
|
|
|
|
2017-11-02 15:15:47 -04:00
|
|
|
###############################
|
|
|
|
# Output #
|
|
|
|
###############################
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Show which actions are run under workers,
|
|
|
|
# and print all the actions running in parallel.
|
|
|
|
# Helps to demonstrate that bazel uses all the cores on the machine.
|
|
|
|
build --experimental_ui
|
|
|
|
test --experimental_ui
|
2017-12-06 09:56:49 -05:00
|
|
|
|
2018-01-25 12:55:27 -05:00
|
|
|
################################
|
|
|
|
# Settings for CircleCI #
|
|
|
|
################################
|
2017-12-13 12:18:16 -05:00
|
|
|
|
2018-01-25 12:55:27 -05:00
|
|
|
# Bazel flags for CircleCI are in /.circleci/bazel.rc
|
2018-05-03 13:40:31 -04:00
|
|
|
|
|
|
|
################################
|
|
|
|
# Temporary Settings for Ivy #
|
|
|
|
################################
|
2018-11-08 12:50:49 -05:00
|
|
|
# to determine if the compiler used should be Ivy or ViewEngine one can use `--define=compile=aot` on
|
build(ivy): support alternate compilation modes to enable Ivy testing (#24056)
Bazel has a restriction that a single output (eg. a compiled version of
//packages/common) can only be produced by a single rule. This precludes
the Angular repo from having multiple rules that build the same code. And
the complexity of having a single rule produce multiple outputs (eg. an
ngc-compiled version of //packages/common and an Ivy-enabled version) is
too high.
Additionally, the Angular repo has lots of existing tests which could be
executed as-is under Ivy. Such testing is very valuable, and it would be
nice to share not only the code, but the dependency graph / build config
as well.
Thus, this change introduces a --define flag 'compile' with three potential
values. When --define=compile=X is set, the entire build system runs in a
particular mode - the behavior of all existing targets is controlled by
the flag. This allows us to reuse our entire build structure for testing
in a variety of different manners. The flag has three possible settings:
* legacy (the default): the traditional View Engine (ngc) build
* local: runs the prototype ngtsc compiler, which does not rely on global
analysis
* jit: runs ngtsc in a mode which executes tsickle, but excludes the
Angular related transforms, which approximates the behavior of plain
tsc. This allows the main packages such as common to be tested with
the JIT compiler.
Additionally, the ivy_ng_module() rule still exists and runs ngc in a mode
where Ivy-compiled output is produced from global analysis information, as
a stopgap while ngtsc is being developed.
PR Close #24056
2018-05-21 18:48:00 -04:00
|
|
|
# any bazel target. This is a temporary flag until codebase is permanently switched to Ivy.
|
2018-10-15 19:51:26 -04:00
|
|
|
build --define=compile=legacy
|
2018-12-01 19:08:15 -05:00
|
|
|
|
|
|
|
###############################
|
|
|
|
# Remote Build Execution support
|
|
|
|
# Turn on these settings with
|
|
|
|
# --config=remote
|
|
|
|
###############################
|
|
|
|
|
|
|
|
# Load default settings for Remote Build Execution
|
2019-01-04 13:59:58 -05:00
|
|
|
# When updating, the URLs of bazel_toolchains in packages/bazel/package.bzl
|
|
|
|
# may also need to be updated (see https://github.com/angular/angular/pull/27935)
|
|
|
|
import %workspace%/third_party/github.com/bazelbuild/bazel-toolchains/bazelrc/bazel-0.21.0.bazelrc
|
2018-12-01 19:08:15 -05:00
|
|
|
|
|
|
|
# Increase the default number of jobs by 50% because our build has lots of
|
|
|
|
# parallelism
|
|
|
|
build:remote --jobs=150
|
|
|
|
|
|
|
|
# Point to our custom execution platform; see tools/BUILD.bazel
|
|
|
|
build:remote --extra_execution_platforms=//tools:rbe_ubuntu1604-angular
|
|
|
|
build:remote --host_platform=//tools:rbe_ubuntu1604-angular
|
|
|
|
build:remote --platforms=//tools:rbe_ubuntu1604-angular
|
|
|
|
|
|
|
|
# Remote instance.
|
|
|
|
build:remote --remote_instance_name=projects/internal-200822/instances/default_instance
|
|
|
|
|
|
|
|
# Do not accept remote cache.
|
|
|
|
# We need to understand the security risks of using prior build artifacts.
|
|
|
|
build:remote --remote_accept_cached=false
|