rules_java
8.5.0
published 23 hours ago
74 stars
66 forks
14 watchers
Apache License 2.0
public
1 assets
5,115,599 downloads
103 KB
Compatability level 1
XCFXV7mmw91TEqPNxIls7z8MWzHbMbqo2g2YhoXUKuQ=
Maintained byHemanshu Vadehra
8.5.0
November 20, 2024

Changes since 8.4.0 349608c3b0fd0bf3856cd0b6acc9e5fe1136714e Release rules_java v8.5.0 97a3dfbd300ace45fd2eaceb620a46ecda9378cb Remove top-level usage of native java_common in java_toolchain.bzl 8bc42909916efeac05d7b05f771a32be57995077 Release rules_java v8.5.0-rc2 7170aea8bf52d4323342420b416ddbd994175822 Release rules_java v8.5.0-rc1 bc4a03fe5525123c04a9fe879dc2882d31e7d690 Add runfiles library to release archive a156fe9afc192a9eccda07d322ad1aee7090e67f Move (and enable) remaining java rules & providers out of @_builtins

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.5.0")

WORKSPACE setup

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.5.0/rules_java-8.5.0.tar.gz",
    ],
    sha256 = "5c215757b9a6c3dd5312a3cdc4896cef3f0c5b31db31baa8da0d988685d42ae4",
)

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules See the source.

Deps:
Assets:

rules_java

  • Postsubmit Build status
  • Postsubmit + Current Bazel Incompatible Flags Build status

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