# https://bazel.build/docs/bazel-and-java#hermetic-testing
# The code is compiled for, executed, and tested on this JVM.
build --java_language_version=17
build --java_runtime_version=remotejdk_21

# https://bazel.build/docs/bazel-and-java#config-build-tools-java
# A second pair of JDK and JVM used to build and execute tools, which are used in the build process, but are not in the build results.
# That JDK and JVM are controlled using --tool_java_language_version and --tool_java_runtime_version
build --tool_java_language_version=17
# Java runtime the tools should use
build --tool_java_runtime_version=remotejdk_17

common --@rules_jvm//:koltin_inc_threshold=0 --@rules_jvm//:java_inc_threshold=0

# make sure you don't need to open file to read compilation errors
common --experimental_ui_max_stdouterr_bytes=-1

# disable deprecated WORKSPACE support
common --noenable_workspace

test --test_verbose_timeout_warnings --test_timeout=60 --test_output=all

# https://www.buildbuddy.io/blog/debugging-slow-bazel-builds/
common --nolegacy_important_outputs --remote_build_event_upload=minimal --remote_cache_async --remote_cache_compression

common --symlink_prefix=/
common --incompatible_enable_proto_toolchain_resolution

# Do not depend on external environment
build --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1

# Remote-caches related
common:remotecache --remote_cache=https://packages.jetbrains.team/files/p/ij/intellij-bazel-cache
common --remote_upload_local_results=false
common:ci --remote_upload_local_results=true

# More debug on CI
common:ci --announce_rc

# TeamCity-specific options
common:teamcity --show_progress_rate_limit=30
