8.14.0
Changes since 8.13.0
3b9ca99 Update to java_tools v16.0
0b94d21 Use root test_deps target from bazel_skylib (#306)
aec334a Migrate from deprecated cc_linking_context.libraries_to_link to cc_linking_context.linker_inputs.libraries
d3f3408 Make C++ toolchain explicitly not mandatory
3daed1a Update @rules_java CI to use Bazel 8.3.0
MODULE.bazel setup
bazel_dep(name = "rules_java", version = "8.14.0")
WORKSPACE setup
With Bazel 8.0.0 and before 8.3.0, add the following to your file:
# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals
In all cases, add the following to your file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_java",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/8.14.0/rules_java-8.14.0.tar.gz",
],
sha256 = "bbe7d94360cc9ed4607ec5fd94995fd1ec41e84257020b6f09e64055281ecb12",
)
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()
load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()
# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")
# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()
Using the rules
See the source.