Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rules_java to 8.6.0 #122

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use_repo(
"org_robolectric_android_all_instrumented_9_robolectric_4913185_2_i7",
)

bazel_dep(name = "rules_java", version = "7.12.2")
bazel_dep(name = "rules_java", version = "8.6.0")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "rules_python", version = "0.37.2")

Expand Down
15 changes: 12 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,25 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "rules_java",
sha256 = "a9690bc00c538246880d5c83c233e4deb83fe885f54c21bb445eb8116a180b83",
sha256 = "8475fae7a95463a4fd323a46b0f5601f89863ba019afa358cc9fa1d0e67cdd63",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/7.12.2/rules_java-7.12.2.tar.gz",
"https://github.com/bazelbuild/rules_java/releases/download/8.6.0/rules_java-8.6.0.tar.gz",
],
)

load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")

rules_java_dependencies()

# 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()

load("//bazel:robolectric.bzl", "robolectric_repositories")
Expand Down
200 changes: 0 additions & 200 deletions bazel/java/http_jar.bzl

This file was deleted.

2 changes: 1 addition & 1 deletion bazel/robolectric.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Robolectric repositories
"""

load("//bazel/java:http_jar.bzl", "http_jar")
load("@rules_java//java:http_jar.bzl", "http_jar")

def robolectric_version(version, sha256, url = None):
"""Define a struct representation of an instrumented Robolectric jar.
Expand Down
23 changes: 23 additions & 0 deletions examples/simple/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,29 @@ load("@rules_android//android:rules.bzl", "android_sdk_repository")
android_sdk_repository(name = "androidsdk")

#---SNIP--- Below here is re-used in the workspace snippet published on releases
http_archive(
name = "rules_java",
sha256 = "8475fae7a95463a4fd323a46b0f5601f89863ba019afa358cc9fa1d0e67cdd63",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/8.6.0/rules_java-8.6.0.tar.gz",
],
)

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")

rules_java_dependencies()

# 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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are users on the consuming side of these rules going to do this as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WORKSPACE users will have to copy paste this whole part into their WORKSPACE at minimum. If they actually need the whole protobuf setup, they'll need to invoke @com_google_protobuf//:protobuf_deps.bzl.

The WORKSPACE setup for a bunch of repositories (including rules_android) will get more complicated as we creep towards Bazel 8 unfortunately.


# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")

rules_java_toolchains()

http_archive(
name = "rules_python",
sha256 = "c6fb25d0ba0246f6d5bd820dd0b2e66b339ccc510242fd4956b9a639b548d113",
Expand Down
Loading