commit | a0df97cd25f9784da04f55ac037eee4ae0fa777c | [log] [tgz] |
---|---|---|
author | Yun Peng <pcloudy@google.com> | Fri Jul 04 17:41:27 2025 +0200 |
committer | GitHub <noreply@github.com> | Fri Jul 04 17:41:27 2025 +0200 |
tree | 5a94c04ce9d57f89026551f258b82eb5ee1a77a5 | |
parent | d3f34085e87d436e12e1df2fa2d018cba59d0e2b [diff] |
Use root test_deps target from bazel_skylib Fixing ``` $ bazel build //src/test/java/com/google/devtools/build/lib/query2/cquery:FilesOutputFormatterCallbackTest INFO: Invocation ID: a90dc4d1-9d48-4164-a9d1-7d82a393fc37 INFO: Options provided by the client: Inherited 'common' options: --isatty=1 --terminal_columns=170 INFO: Reading rc options for 'build' from /Users/pcloudy/workspace/bazel/.bazelrc: Inherited 'common' options: --enable_platform_specific_config --check_direct_dependencies=error --downloader_config=bazel_downloader.cfg INFO: Reading rc options for 'build' from /Users/pcloudy/workspace/bazel/.bazelrc: 'build' options: --java_runtime_version=21 --java_language_version=21 --tool_java_language_version=21 --tool_java_runtime_version=21 INFO: Reading rc options for 'build' from /Users/pcloudy/.bazelrc: 'build' options: --verbose_failures --announce_rc --disk_cache=/tmp/bazel_disk_cache --repository_cache=/tmp/bazel_repository_cache INFO: Found applicable config definition build:macos in file /Users/pcloudy/workspace/bazel/.bazelrc: --host_macos_minimum_os=10.13 --macos_minimum_os=10.13 --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --per_file_copt=external/.*@-w --host_per_file_copt=external/.*@-w DEBUG: /private/var/tmp/_bazel_pcloudy/829441223e9fec5a5a2e3d1dd743fdf0/external/grpc-java+/java_grpc_library.bzl:201:14: Multiple values in 'deps' is deprecated in build_bazel_remote_execution_v2_remote_execution_java_grpc ERROR: /private/var/tmp/_bazel_pcloudy/829441223e9fec5a5a2e3d1dd743fdf0/external/rules_java+/java/BUILD:78:10: in filegroup rule @@rules_java+//java:for_bazel_tests: Visibility error: target '@@bazel_skylib+//lib:test_deps' is not visible from target '@@rules_java+//java:for_bazel_tests' Recommendation: modify the visibility declaration if you think the dependency is legitimate. For more info see https://bazel.build/concepts/visibility ``` after upgrading bazel_skylib which contains https://github.com/bazelbuild/bazel-skylib/pull/508
Java Rules for Bazel https://bazel.build.
Documentation
For a quickstart tutorial, see https://bazel.build/start/java
For slightly more advanced usage, like setting up toolchains or writing your own java-like rules, see https://bazel.build/docs/bazel-and-java
Core Java rules
Add a load like:
load("@rules_java//java:java_library.bzl", "java_library")
to your BUILD
/ BUILD.bazel
/ bzl` files
For detailed docs on the core rules, see https://bazel.build/reference/be/java