Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.
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
1 change: 1 addition & 0 deletions dependencies.properties
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ maven.org_apache_commons_commons_lang3=org.apache.commons:commons-lang3:3.6
# Used by grpc stub
maven.javax_annotation_javax_annotation_api=javax.annotation:javax.annotation-api:1.2
maven.com_google_guava_failureaccess=com.google.guava:failureaccess:1.0.1
maven.com_google_android_annotations=com.google.android:annotations:4.1.1.4

# Testing maven artifacts
maven.junit_junit=junit:junit:4.12
Expand Down
39 changes: 29 additions & 10 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,39 @@ def com_google_api_gax_java_repositories():
# version, while Bazel will depend on Bazel workspaces). The versions are shared in the
# properties file.

# A temporary hack, to fix incompatibility of protobuf 3.6.1 with new Bazel versions.
# We have to do it, because version 3.6.1.3 exists only as a Bazel workspace, but not as
# a maven artifact.
# Remove once upgraded to 3.7.0
_protobuf_version = PROPERTIES["version.com_google_protobuf"]
if _protobuf_version == "3.6.1":
_protobuf_version = "3.6.1.3"
_protobuf_version_in_link = "v%s" % _protobuf_version
_maybe(
http_archive,
name = "com_google_protobuf",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v%s.zip" % _protobuf_version],
urls = ["https://github.com/protocolbuffers/protobuf/archive/%s.zip" % _protobuf_version_in_link],
strip_prefix = "protobuf-%s" % _protobuf_version,
)

_grpc_version = PROPERTIES["version.io_grpc"]
_grpc_version_in_link = "v%s" % _grpc_version
if _grpc_version == "1.19.0":
_grpc_version = "952a767b9c470b38fe3ae4847f20bc1403071fb7"
_grpc_version_in_link = _grpc_version
_maybe(
http_archive,
name = "io_grpc_grpc_java",
urls = ["https://github.com/grpc/grpc-java/archive/%s.zip" % _grpc_version_in_link],
strip_prefix = "grpc-java-%s" % _grpc_version,
)

_maybe(
http_archive,
name = "bazel_skylib",
strip_prefix = "bazel-skylib-0.7.0",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/0.7.0.zip"],
)

_maybe(
http_archive,
name = "net_zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
strip_prefix = "zlib-1.2.11",
urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
)

_maybe(
native.maven_jar,
name = "io_grpc_grpc_netty_shaded",
Expand All @@ -94,6 +101,18 @@ def com_google_api_gax_java_repositories():
actual = "@com_google_code_gson_gson//jar",
)

_maybe(
native.bind,
name = "zlib",
actual = "@net_zlib//:zlib",
)

_maybe(
native.bind,
name = "error_prone_annotations",
actual = "@com_google_errorprone_error_prone_annotations//jar",
)

def _maybe(repo_rule, name, strip_repo_prefix = "", **kwargs):
if not name.startswith(strip_repo_prefix):
return
Expand Down