Skip to content

Commit 36e687f

Browse files
committedJul 23, 2024·
examples: Add bzlmod support
This also updates the version number of the grpc-java module as part of the release process.
1 parent 85e0a01 commit 36e687f

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed
 

‎.github/workflows/testing.yml

+10
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,17 @@ jobs:
9797
- name: Run bazel build
9898
run: bazelisk build //... --enable_bzlmod=false
9999

100+
- name: Run example bazel build
101+
run: bazelisk build //... --enable_bzlmod=false
102+
working-directory: ./examples
103+
100104
- name: Run bazel build (bzlmod)
101105
env:
102106
USE_BAZEL_VERSION: 7.0.0
103107
run: bazelisk build //... --enable_bzlmod=true
108+
109+
- name: Run example bazel build (bzlmod)
110+
env:
111+
USE_BAZEL_VERSION: 7.0.0
112+
run: bazelisk build //... --enable_bzlmod=true
113+
working-directory: ./examples

‎MODULE.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module(
22
name = "grpc-java",
33
compatibility_level = 0,
44
repo_name = "io_grpc_grpc_java",
5-
version = "0",
5+
version = "1.66.0-SNAPSHOT", # CURRENT_GRPC_VERSION
66
)
77

88
# GRPC_DEPS_START

‎RELEASING.md

+2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ them before continuing, and set them again when resuming.
1818
```bash
1919
MAJOR=1 MINOR=7 PATCH=0 # Set appropriately for new release
2020
VERSION_FILES=(
21+
MODULE.bazel
2122
build.gradle
2223
core/src/main/java/io/grpc/internal/GrpcUtil.java
24+
examples/MODULE.bazel
2325
examples/build.gradle
2426
examples/pom.xml
2527
examples/android/clientcache/app/build.gradle

‎examples/MODULE.bazel

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
bazel_dep(name = "grpc-java", repo_name = "io_grpc_grpc_java", version = "1.66.0-SNAPSHOT") # CURRENT_GRPC_VERSION
2+
bazel_dep(name = "grpc-proto", repo_name = "io_grpc_grpc_proto", version = "0.0.0-20240627-ec30f58")
3+
bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "23.1")
4+
bazel_dep(name = "rules_jvm_external", version = "6.0")
5+
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
6+
7+
# Do not use this override in your own MODULE.bazel. Use a version from BCR
8+
local_path_override(
9+
module_name = "grpc-java",
10+
path = "..",
11+
)
12+
13+
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
14+
15+
use_repo(maven, "maven")
16+
17+
maven.install(
18+
artifacts = [
19+
"com.google.api.grpc:grpc-google-cloud-pubsub-v1:0.1.24",
20+
"com.google.api.grpc:proto-google-cloud-pubsub-v1:0.1.24",
21+
],
22+
repositories = ["https://repo.maven.apache.org/maven2/"],
23+
strict_visibility = True,
24+
)

‎examples/WORKSPACE.bzlmod

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# When using bzlmod this makes sure nothing from the legacy WORKSPACE is loaded

0 commit comments

Comments
 (0)
Please sign in to comment.