xref: /aosp_15_r20/external/bazelbuild-rules_rust/examples/.bazelrc (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1*d4726bddSHONG Yifan# `.bazelrc` is a Bazel configuration file.
2*d4726bddSHONG Yifan# https://bazel.build/docs/best-practices#bazelrc-file
3*d4726bddSHONG Yifan
4*d4726bddSHONG Yifan# Required on windows
5*d4726bddSHONG Yifancommon --enable_platform_specific_config
6*d4726bddSHONG Yifanstartup --windows_enable_symlinks
7*d4726bddSHONG Yifanbuild:windows --enable_runfiles
8*d4726bddSHONG Yifan
9*d4726bddSHONG Yifan# Enable rustfmt for all targets in the workspace
10*d4726bddSHONG Yifanbuild:rustfmt --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
11*d4726bddSHONG Yifanbuild:rustfmt --output_groups=+rustfmt_checks
12*d4726bddSHONG Yifan
13*d4726bddSHONG Yifan# Enable clippy for all targets in the workspace
14*d4726bddSHONG Yifanbuild:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
15*d4726bddSHONG Yifanbuild:clippy --output_groups=+clippy_checks
16*d4726bddSHONG Yifan
17*d4726bddSHONG Yifan# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
18*d4726bddSHONG Yifan# https://github.com/bazelbuild/rules_rust/issues/2181
19*d4726bddSHONG Yifancommon --noenable_bzlmod
20*d4726bddSHONG Yifan
21*d4726bddSHONG Yifan# This isn't currently the defaut in Bazel, but we enable it to test we'll be ready if/when it flips.
22*d4726bddSHONG Yifanbuild --incompatible_disallow_empty_glob
23*d4726bddSHONG Yifan
24*d4726bddSHONG Yifanbuild --java_runtime_version=remotejdk_21
25*d4726bddSHONG Yifanbuild --java_language_version=21
26*d4726bddSHONG Yifanbuild --tool_java_runtime_version=remotejdk_21
27*d4726bddSHONG Yifanbuild --tool_java_language_version=21
28*d4726bddSHONG Yifan
29*d4726bddSHONG Yifan# This import should always be last to allow users to override
30*d4726bddSHONG Yifan# settings for local development.
31*d4726bddSHONG Yifantry-import %workspace%/user.bazelrc
32