Skip to content

Commit 3a45042

Browse files
authored
Merge pull request #33 from qiwzhang/remove_api_binding
Update googleapis and protobuf
2 parents 64d6ac9 + c92af4e commit 3a45042

File tree

1 file changed

+85
-29
lines changed

1 file changed

+85
-29
lines changed

repositories.bzl

Lines changed: 85 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,91 @@ def absl_repositories(bind=True):
2727
sha256 = ABSEIL_SHA256,
2828
)
2929

30-
PROTOBUF_COMMIT = "106ffc04be1abf3ff3399f54ccf149815b287dd9" # v3.5.1
31-
PROTOBUF_SHA256 = "ebc5f911ae580234da9cbcff03b841395bd97861efc82f67a165c5c3d366f2c6"
30+
def zlib_repositories(bind = True):
31+
BUILD = """
32+
# Copyright 2016 Google Inc. All Rights Reserved.
33+
#
34+
# Licensed under the Apache License, Version 2.0 (the "License");
35+
# you may not use this file except in compliance with the License.
36+
# You may obtain a copy of the License at
37+
#
38+
# http://www.apache.org/licenses/LICENSE-2.0
39+
#
40+
# Unless required by applicable law or agreed to in writing, software
41+
# distributed under the License is distributed on an "AS IS" BASIS,
42+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
43+
# See the License for the specific language governing permissions and
44+
# limitations under the License.
45+
#
46+
################################################################################
47+
#
48+
licenses(["notice"])
49+
exports_files(["README"])
50+
cc_library(
51+
name = "zlib",
52+
srcs = [
53+
"adler32.c",
54+
"crc32.c",
55+
"crc32.h",
56+
"deflate.c",
57+
"deflate.h",
58+
"infback.c",
59+
"inffast.c",
60+
"inffast.h",
61+
"inffixed.h",
62+
"inflate.c",
63+
"inflate.h",
64+
"inftrees.c",
65+
"inftrees.h",
66+
"trees.c",
67+
"trees.h",
68+
"zconf.h",
69+
"zutil.c",
70+
"zutil.h",
71+
],
72+
hdrs = [
73+
"zlib.h",
74+
],
75+
copts = [
76+
"-Wno-shift-negative-value",
77+
"-Wno-unknown-warning-option",
78+
],
79+
defines = [
80+
"Z_SOLO",
81+
],
82+
visibility = [
83+
"//visibility:public",
84+
],
85+
)
86+
"""
87+
http_archive(
88+
name = "zlib",
89+
strip_prefix = "zlib-1.2.11",
90+
urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"],
91+
sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff",
92+
build_file_content = BUILD,
93+
)
94+
95+
96+
BAZEL_SKYLIB_RELEASE = "0.8.0"
97+
BAZEL_SKYLIB_SHA256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e"
98+
99+
PROTOBUF_COMMIT = "3.9.0" # July 10, 2019
100+
PROTOBUF_SHA256 = "2ee9dcec820352671eb83e081295ba43f7a4157181dad549024d7070d079cf65"
32101

33102
def protobuf_repositories(bind=True):
103+
zlib_repositories(bind)
104+
105+
http_archive(
106+
name = "bazel_skylib",
107+
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/" + BAZEL_SKYLIB_RELEASE + "/bazel-skylib." + BAZEL_SKYLIB_RELEASE + ".tar.gz"],
108+
sha256 = BAZEL_SKYLIB_SHA256,
109+
)
110+
34111
http_archive(
35112
name = "protobuf_git",
36113
strip_prefix = "protobuf-" + PROTOBUF_COMMIT,
37-
url = "https://github.com/google/protobuf/archive/" + PROTOBUF_COMMIT + ".tar.gz",
114+
url = "https://github.com/google/protobuf/archive/v" + PROTOBUF_COMMIT + ".tar.gz",
38115
sha256 = PROTOBUF_SHA256,
39116
)
40117

@@ -158,8 +235,8 @@ cc_library(
158235
actual = "@googletest_git//:googletest_prod",
159236
)
160237

161-
GOOGLEAPIS_COMMIT = "5c6df0cd18c6a429eab739fb711c27f6e1393366" # May 14, 2017
162-
GOOGLEAPIS_SHA256 = "c6ce26246232c0f3e78d3a30f087444ec01c8ee64b34d058bfcd4f0f4a387a0b"
238+
GOOGLEAPIS_COMMIT = "32a10f69e2c9ce15bba13ab1ff928bacebb25160" # May 20, 2019
239+
GOOGLEAPIS_SHA256 = "6861efa8619579e06e70dd4765cdf6cef1ecad6a1a2026ad750541e99552bf71"
163240

164241
def googleapis_repositories(protobuf_repo="@protobuf_git//", bind=True):
165242
BUILD = """
@@ -198,30 +275,6 @@ cc_proto_library(
198275
deps = ["{0}:cc_wkt_protos"],
199276
)
200277
201-
cc_proto_library(
202-
name = "servicecontrol",
203-
srcs = [
204-
"google/api/servicecontrol/v1/check_error.proto",
205-
"google/api/servicecontrol/v1/distribution.proto",
206-
"google/api/servicecontrol/v1/log_entry.proto",
207-
"google/api/servicecontrol/v1/metric_value.proto",
208-
"google/api/servicecontrol/v1/operation.proto",
209-
"google/api/servicecontrol/v1/service_controller.proto",
210-
"google/logging/type/http_request.proto",
211-
"google/logging/type/log_severity.proto",
212-
"google/rpc/error_details.proto",
213-
"google/rpc/status.proto",
214-
"google/type/money.proto",
215-
],
216-
include = ".",
217-
visibility = ["//visibility:public"],
218-
deps = [
219-
":service_config",
220-
],
221-
protoc = "//external:protoc",
222-
default_runtime = "//external:protobuf",
223-
)
224-
225278
cc_proto_library(
226279
name = "service_config",
227280
srcs = [
@@ -234,13 +287,15 @@ cc_proto_library(
234287
"google/api/documentation.proto",
235288
"google/api/endpoint.proto",
236289
"google/api/label.proto",
290+
"google/api/launch_stage.proto",
237291
"google/api/log.proto",
238292
"google/api/logging.proto",
239293
"google/api/metric.proto",
240294
"google/api/experimental/experimental.proto",
241295
"google/api/experimental/authorization_config.proto",
242296
"google/api/monitored_resource.proto",
243297
"google/api/monitoring.proto",
298+
"google/api/resource.proto",
244299
"google/api/quota.proto",
245300
"google/api/service.proto",
246301
"google/api/source_info.proto",
@@ -260,6 +315,7 @@ cc_proto_library(
260315

261316
http_archive(
262317
name = "googleapis_git",
318+
patch_cmds = ["find . -type f -name '*BUILD*' | xargs rm"],
263319
strip_prefix = "googleapis-" + GOOGLEAPIS_COMMIT,
264320
url = "https://github.com/googleapis/googleapis/archive/" + GOOGLEAPIS_COMMIT + ".tar.gz",
265321
build_file_content = BUILD,

0 commit comments

Comments
 (0)