Skip to content

Commit 78d9147

Browse files
authored
deps: upgrade gax to 2.7.1, protobuf to 3.19.1, grpc to 1.42.1, and truth to 1.1.2, upgrade Bazel in GitHub Actions, and fix build error (#875)
* chore: upgrade protobuf and grpc, and fix build error * chore: fix build * chore: re-order load * chore: upgrade gax * chore: upgrade google truth * chore: upgrade bazel
1 parent 7c76256 commit 78d9147

5 files changed

Lines changed: 29 additions & 14 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ name: ci
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10-
container: gcr.io/gapic-images/googleapis-bazel:20210105
11-
# Dockerfile for this image: https://github.com/googleapis/googleapis-discovery/blob/main/Dockerfile
12-
# If you update its version, please also update it below in
13-
# 'Cache Bazel files' - unfortunately it cannot accept variables at this
14-
# time.
1510

1611
strategy:
1712
matrix:
@@ -28,7 +23,7 @@ jobs:
2823
uses: actions/cache@v2
2924
with:
3025
path: ~/.cache/bazel
31-
key: ${{ runner.os }}-bazel-20210105-${{ secrets.CACHE_VERSION }}
26+
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}
3227

3328
- name: Bazel Cache Not Found
3429
if: steps.cache-bazel.outputs.cache-hit != 'true'

WORKSPACE

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jvm_maven_import_external(
3333
# which in its turn, prioritizes actual generated clients runtime dependencies
3434
# over the generator dependencies.
3535

36-
_gax_java_version = "2.7.0"
36+
_gax_java_version = "2.7.1"
3737

3838
http_archive(
3939
name = "com_google_api_gax_java",
@@ -65,7 +65,27 @@ load("//:repositories.bzl", "gapic_generator_java_repositories")
6565
gapic_generator_java_repositories()
6666

6767
# protobuf
68-
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
68+
RULES_JVM_EXTERNAL_TAG = "4.2"
69+
RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca"
70+
71+
http_archive(
72+
name = "rules_jvm_external",
73+
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
74+
sha256 = RULES_JVM_EXTERNAL_SHA,
75+
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
76+
)
77+
78+
load("@com_google_protobuf//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")
79+
80+
load("@rules_jvm_external//:defs.bzl", "maven_install")
81+
82+
maven_install(
83+
artifacts = PROTOBUF_MAVEN_ARTIFACTS,
84+
generate_compat_repositories = True,
85+
repositories = [
86+
"https://repo.maven.apache.org/maven2/",
87+
],
88+
)
6989

7090
protobuf_deps()
7191

dependencies.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
# Target workspace name: gapic_generator_java
88

99
# Versions only, for dependencies which actual artifacts differ between Bazel and Gradle
10-
version.com_google_protobuf=3.15.8
10+
version.com_google_protobuf=3.19.1
1111
# Version of google-java-format is downgraded from 1.8 to 1.7, because 1.8 supports java 11 minimum, while our JRE is java 8.
1212
version.google_java_format=1.7
1313
version.com_google_api_common_java=1.9.3
14-
version.io_grpc_java=1.30.2
14+
version.io_grpc_java=1.42.1
1515

1616
# Common deps.
1717
maven.com_google_guava_guava=com.google.guava:guava:30.1-android
1818
maven.com_google_code_findbugs_jsr305=com.google.code.findbugs:jsr305:3.0.0
1919
maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.7.2
2020
maven.com_google_auto_value_auto_value_annotations=com.google.auto.value:auto-value-annotations:1.7.2
2121
maven.com_google_code_gson=com.google.code.gson:gson:2.8.6
22-
maven.com_google_protobuf_protobuf_java=com.google.protobuf:protobuf-java:3.15.8
22+
maven.com_google_protobuf_protobuf_java=com.google.protobuf:protobuf-java:3.19.1
2323
maven.io_github_java_diff_utils=io.github.java-diff-utils:java-diff-utils:4.0
2424
maven.javax_annotation_javax_annotation_api=javax.annotation:javax.annotation-api:1.3.2
2525
maven.javax_validation_javax_validation_api=javax.validation:validation-api:2.0.1.Final
@@ -37,4 +37,4 @@ maven.junit_junit=junit:junit:4.13.1
3737
maven.org_hamcrest_hamcrest_core=org.hamcrest:hamcrest-core:1.3
3838
maven.org_mockito_mockito_core=org.mockito:mockito-core:2.21.0
3939
# Keep in sync with gax-java.
40-
maven.com_google_truth_truth=com.google.truth:truth:1.0
40+
maven.com_google_truth_truth=com.google.truth:truth:1.1.2

repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def gapic_generator_java_repositories():
109109
)
110110

111111
# grpc-proto doesn't have releases, so we use hashes instead.
112-
_io_grpc_proto_prefix = "0020624375a8ee4c7dd9b3e513e443b90bc28990" # Aug. 20, 2020.
112+
_io_grpc_proto_prefix = "8e3fec8612bc0708e857950dccadfd5063703e04" # Nov. 6, 2021.
113113
_maybe(
114114
http_archive,
115115
name = "io_grpc_proto",

src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ private MethodInvocationExpr getExpr(VariableExpr var, String num) {
474474
private List<Expr> setOperationSnapshotFactoryExpr(
475475
Method protoMethod, Map<String, Message> messageTypes) {
476476

477-
// Generate input varibles for create()
477+
// Generate input variables for create()
478478
VariableExpr requestVarExpr =
479479
VariableExpr.withVariable(
480480
Variable.builder().setType(protoMethod.inputType()).setName("request").build());

0 commit comments

Comments
 (0)