blob: 2ed712d9355db54d6d876a56e434a758e8e335b7 [file] [log] [blame]
Jingwen Chen0b36a7c2021-02-03 08:29:55 -05001# Platforms and toolchains for AOSP.
2#
Jingwen Chen3b3e56b2021-10-07 10:28:45 +00003# Set default target platform for builds to rely on product config's arch and os variables
4build --platforms //build/bazel/platforms:android_target
Jingwen Chen0b36a7c2021-02-03 08:29:55 -05005
Jingwen Chen3b3e56b2021-10-07 10:28:45 +00006# Use toolchain resolution to find the cc toolchain.
Jingwen Chen0b36a7c2021-02-03 08:29:55 -05007build --incompatible_enable_cc_toolchain_resolution
8
Jingwen Chen9135d6b2021-04-07 13:53:14 +00009# Ensure that the host_javabase always use @local_jdk, the checked-in JDK.
Alex Humesky32596dd2021-08-13 02:06:23 +000010build --tool_java_runtime_version=local_jdk
Romain Jobredeaux9d3fe1c2021-08-26 14:44:30 +000011build --java_runtime_version=local_jdk
Jingwen Chen9135d6b2021-04-07 13:53:14 +000012
Jingwen Chen14e89032020-10-12 10:32:35 +000013# Lock down the PATH variable in actions to /usr/bin and /usr/local/bin.
14build --experimental_strict_action_env
15
16# Explicitly allow unresolved symlinks (it's an experimental Bazel feature)
17build --experimental_allow_unresolved_symlinks
18
Chris Parsonscebcbe22021-05-25 12:22:58 -040019# Enable usage of experimental cc-related build APIs
Jingwen Chen14e89032020-10-12 10:32:35 +000020build --experimental_cc_shared_library
Chris Parsonscebcbe22021-05-25 12:22:58 -040021build --experimental_starlark_cc_import
Jingwen Chen14e89032020-10-12 10:32:35 +000022
Jingwen Chenfcb0c322021-05-12 10:45:51 +000023# Do not tokenize copts, other than strings that consist of a single Make
24# variable. This prevents the need to double-escape characters like backslashes
25# and quotes in copts.
26build --features no_copts_tokenization
27
Chris Parsons6c70b3c2021-03-01 19:34:56 -050028# Disable local cpp toolchain detection, as it is explicitly declared in AOSP.
29build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
30
Chris Parsons200cd8f2021-04-22 12:21:48 -040031# Disable sandboxing for CppCompile actions, as headers are not fully specified.
32# TODO(b/186116353): This is a temporary fix, as appropriately-sandboxed actions
33# are a long term goal.
34build --strategy=CppCompile=standalone
35
Chris Parsonsdfa069e2021-05-18 13:46:27 -040036# Enable use of the implementation_deps attribute in native cc rules
Jingwen Chen4c9bf6f2021-05-18 23:38:28 +000037build --experimental_cc_implementation_deps
Chris Parsonsdfa069e2021-05-18 13:46:27 -040038
Jingwen Chen14e89032020-10-12 10:32:35 +000039# Enable building targets in //external:__subpackages__.
40common --experimental_sibling_repository_layout
41common --experimental_disable_external_package
Jingwen Chen2c119162020-10-13 22:52:53 +000042
43# Enable toplevel_output_directories and Ninja executor in Bazel
44common --experimental_ninja_actions
Jingwen Chen730a4b62020-11-05 03:29:34 -050045
46# Increase refresh rate of command line UI for improved perceived responsiveness.
47common --show_progress_rate_limit=0.05
48
49# These are disabled when running under soong_ui (default = auto). Force enable them here.
50common --color=yes
51common --curses=yes
52
53# Show the full set of flags for observability and debuggability.
54common --announce_rc
55
Jingwen Chen5671a1e2020-11-05 04:23:13 -050056# Run bazel query from the workspace, without cd'ing into out/soong/queryview
57# Note that this hardcodes the output dir. It will not work if $OUT_DIR != out.
58common:queryview --package_path=%workspace%/out/soong/queryview
59
Chris Parsons360632d2021-04-21 18:45:12 -040060# Run bazel query from the workspace, without cd'ing into out/soong/workspace
Jingwen Chene43ad632020-12-02 04:37:31 -050061# Note that this hardcodes the output dir. It will not work if $OUT_DIR != out.
Chris Parsons360632d2021-04-21 18:45:12 -040062common:bp2build --package_path=%workspace%/out/soong/workspace
Jingwen Chene43ad632020-12-02 04:37:31 -050063
Jingwen Chen730a4b62020-11-05 03:29:34 -050064# Support a local user-specific bazelrc file.
65try-import %workspace%/user.bazelrc
Alex Humeskya8d3f7c2021-03-18 01:28:38 -040066
67build --android_sdk=//prebuilts/sdk:android_sdk
68build --experimental_enable_android_migration_apis
69build --experimental_google_legacy_api
70build --incompatible_java_common_parameters
71build --android_databinding_use_v3_4_args
72build --experimental_android_databinding_v2
Romain Jobredeaux86499f42021-08-02 17:22:32 +000073build --define=android_incremental_dexing_tool=d8_dexbuilder
74build --define=android_dexmerger_tool=d8_dexmerger
75build --nouse_workers_with_dexbuilder
Romain Jobredeaux9d3fe1c2021-08-26 14:44:30 +000076build --fat_apk_cpu=k8
Jingwen Chenedb7db02021-04-13 08:16:03 +000077
78# Developer instance for result storage. This only works if you have access
79# to the Bazel GCP project. Follow the GCP gcloud client's auth instructions to
80# use --google_default_credentials.
81build:results --remote_instance_name=projects/bazel-untrusted/instances/default_instance
82build:results --project_id=bazel-untrusted
83build:results --remote_timeout=600
84build:results --google_default_credentials
85build:results --test_summary=detailed
86build:results --bes_backend=buildeventservice.googleapis.com
87build:results --bes_results_url=https://source.cloud.google.com/results/invocations
88build:results --show_progress_rate_limit=5