diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index e852cd552c..d8d4e3f82c 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -23,6 +23,8 @@ version.gax_httpjson=0.114.1-SNAPSHOT # Versions for dependencies which actual artifacts differ between Bazel and Gradle. # Gradle build depends on prebuilt maven artifacts, while Bazel build depends on Bazel workspaces # with the sources. +# The protobuf version is only used for generating gradle files for showcase module, +# not for self-service clients (from googleapis project). version.com_google_protobuf=3.23.2 version.google_java_format=1.15.0 version.io_grpc=1.54.0 diff --git a/rules_java_gapic/java_gapic_pkg.bzl b/rules_java_gapic/java_gapic_pkg.bzl index 36a0d4314c..d6b7e7d66a 100644 --- a/rules_java_gapic/java_gapic_pkg.bzl +++ b/rules_java_gapic/java_gapic_pkg.bzl @@ -13,6 +13,7 @@ # limitations under the License. load("@com_google_api_gax_java_properties//:dependencies.properties.bzl", "PROPERTIES") +load("@com_google_protobuf//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION") def _wrapPropertyNamesInBraces(properties): wrappedProperties = {} @@ -20,7 +21,12 @@ def _wrapPropertyNamesInBraces(properties): wrappedProperties["{{%s}}" % k] = v return wrappedProperties -_PROPERTIES = _wrapPropertyNamesInBraces(PROPERTIES) +# Before this replacement, there was a problem (e.g., b/284292352) when +# the version of protobuf defined in googleapis is higher than protobuf +# defined in gax-java/dependencies.properties, use this replacement to +# sync the two versions. +SYNCED_PROPERTIES = PROPERTIES | {"version.com_google_protobuf": PROTOBUF_JAVA_VERSION} +_PROPERTIES = _wrapPropertyNamesInBraces(SYNCED_PROPERTIES) # ======================================================================== # General packaging helpers. @@ -63,7 +69,7 @@ def _gapic_pkg_tar_impl(ctx): for f in dep.files.to_list(): deps.append(f) - samples =[] + samples = [] for s in ctx.attr.samples: for f in s.files.to_list(): samples.append(f)