|
14 | 14 | #
|
15 | 15 | ################################################################################
|
16 | 16 | #
|
17 |
| -def zlib_repositories(bind=True): |
18 |
| - BUILD = """ |
19 |
| -# Copyright 2016 Google Inc. All Rights Reserved. |
20 |
| -# |
21 |
| -# Licensed under the Apache License, Version 2.0 (the "License"); |
22 |
| -# you may not use this file except in compliance with the License. |
23 |
| -# You may obtain a copy of the License at |
24 |
| -# |
25 |
| -# http://www.apache.org/licenses/LICENSE-2.0 |
26 |
| -# |
27 |
| -# Unless required by applicable law or agreed to in writing, software |
28 |
| -# distributed under the License is distributed on an "AS IS" BASIS, |
29 |
| -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
30 |
| -# See the License for the specific language governing permissions and |
31 |
| -# limitations under the License. |
32 |
| -# |
33 |
| -################################################################################ |
34 |
| -# |
35 |
| -
|
36 |
| -licenses(["notice"]) |
37 |
| -
|
38 |
| -exports_files(["README"]) |
39 |
| -
|
40 |
| -cc_library( |
41 |
| - name = "zlib", |
42 |
| - srcs = [ |
43 |
| - "adler32.c", |
44 |
| - "crc32.c", |
45 |
| - "crc32.h", |
46 |
| - "deflate.c", |
47 |
| - "deflate.h", |
48 |
| - "infback.c", |
49 |
| - "inffast.c", |
50 |
| - "inffast.h", |
51 |
| - "inffixed.h", |
52 |
| - "inflate.c", |
53 |
| - "inflate.h", |
54 |
| - "inftrees.c", |
55 |
| - "inftrees.h", |
56 |
| - "trees.c", |
57 |
| - "trees.h", |
58 |
| - "zconf.h", |
59 |
| - "zutil.c", |
60 |
| - "zutil.h", |
61 |
| - ], |
62 |
| - hdrs = [ |
63 |
| - "zlib.h", |
64 |
| - ], |
65 |
| - copts = [ |
66 |
| - "-Wno-shift-negative-value", |
67 |
| - "-Wno-unknown-warning-option", |
68 |
| - ], |
69 |
| - defines = [ |
70 |
| - "Z_SOLO", |
71 |
| - ], |
72 |
| - visibility = [ |
73 |
| - "//visibility:public", |
74 |
| - ], |
75 |
| -) |
76 |
| -""" |
77 |
| - |
78 |
| - native.new_git_repository( |
79 |
| - name = "zlib_git", |
80 |
| - build_file_content = BUILD, |
81 |
| - commit = "50893291621658f355bc5b4d450a8d06a563053d", # v1.2.8 |
82 |
| - remote = "https://github.com/madler/zlib.git", |
83 |
| - ) |
84 |
| - |
85 |
| - native.bind( |
86 |
| - name = "zlib", |
87 |
| - actual = "@zlib_git//:zlib" |
88 |
| - ) |
89 |
| - |
90 |
| -def nanopb_repositories(bind=True): |
91 |
| - BUILD = """ |
92 |
| -# Copyright 2016 Google Inc. All Rights Reserved. |
93 |
| -# |
94 |
| -# Licensed under the Apache License, Version 2.0 (the "License"); |
95 |
| -# you may not use this file except in compliance with the License. |
96 |
| -# You may obtain a copy of the License at |
97 |
| -# |
98 |
| -# http://www.apache.org/licenses/LICENSE-2.0 |
99 |
| -# |
100 |
| -# Unless required by applicable law or agreed to in writing, software |
101 |
| -# distributed under the License is distributed on an "AS IS" BASIS, |
102 |
| -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
103 |
| -# See the License for the specific language governing permissions and |
104 |
| -# limitations under the License. |
105 |
| -# |
106 |
| -################################################################################ |
107 |
| -# |
108 |
| -
|
109 |
| -licenses(["notice"]) |
110 |
| -
|
111 |
| -exports_files(["LICENSE.txt"]) |
112 |
| -
|
113 |
| -cc_library( |
114 |
| - name = "nanopb", |
115 |
| - srcs = [ |
116 |
| - "pb.h", |
117 |
| - "pb_common.c", |
118 |
| - "pb_common.h", |
119 |
| - "pb_decode.c", |
120 |
| - "pb_decode.h", |
121 |
| - "pb_encode.c", |
122 |
| - "pb_encode.h", |
123 |
| - ], |
124 |
| - hdrs = [":includes"], |
125 |
| - visibility = [ |
126 |
| - "//visibility:public", |
127 |
| - ], |
128 |
| -) |
129 |
| -
|
130 |
| -genrule( |
131 |
| - name = "includes", |
132 |
| - srcs = [ |
133 |
| - "pb.h", |
134 |
| - "pb_common.h", |
135 |
| - "pb_decode.h", |
136 |
| - "pb_encode.h", |
137 |
| - ], |
138 |
| - outs = [ |
139 |
| - "third_party/nanopb/pb.h", |
140 |
| - "third_party/nanopb/pb_common.h", |
141 |
| - "third_party/nanopb/pb_decode.h", |
142 |
| - "third_party/nanopb/pb_encode.h", |
143 |
| - ], |
144 |
| - cmd = "mkdir -p $(@D)/third_party/nanopb && cp $(SRCS) $(@D)/third_party/nanopb", |
145 |
| -) |
146 |
| -""" |
147 |
| - |
148 |
| - native.new_git_repository( |
149 |
| - name = "nanopb_git", |
150 |
| - build_file_content = BUILD, |
151 |
| - commit = "f8ac463766281625ad710900479130c7fcb4d63b", |
152 |
| - remote = "https://github.com/nanopb/nanopb.git", |
153 |
| - ) |
154 |
| - |
155 |
| - native.bind( |
156 |
| - name = "nanopb", |
157 |
| - actual = "@nanopb_git//:nanopb", |
158 |
| - ) |
159 |
| - |
160 |
| -def grpc_repositories(bind=True): |
161 |
| - zlib_repositories(bind) |
162 |
| - nanopb_repositories(bind) |
163 |
| - |
164 |
| - native.git_repository( |
165 |
| - name = "grpc_git", |
166 |
| - commit = "bb3edafea245a9780cc4c10f0b58da21e8193f38", # v1.1.1 |
167 |
| - remote = "https://github.com/grpc/grpc.git", |
168 |
| - ) |
169 |
| - |
170 |
| - if bind: |
171 |
| - native.bind( |
172 |
| - name = "gpr", |
173 |
| - actual = "@grpc_git//:gpr", |
174 |
| - ) |
175 |
| - |
176 |
| - native.bind( |
177 |
| - name = "grpc", |
178 |
| - actual = "@grpc_git//:grpc", |
179 |
| - ) |
180 |
| - |
181 |
| - native.bind( |
182 |
| - name = "grpc_cpp_plugin", |
183 |
| - actual = "@grpc_git//:grpc_cpp_plugin", |
184 |
| - ) |
185 |
| - |
186 |
| - native.bind( |
187 |
| - name = "grpc++", |
188 |
| - actual = "@grpc_git//:grpc++", |
189 |
| - ) |
190 |
| - |
191 |
| - native.bind( |
192 |
| - name = "grpc_lib", |
193 |
| - actual = "@grpc_git//:grpc++_codegen_proto", |
194 |
| - ) |
195 |
| - |
196 |
| -def googleapis_repositories(protobuf_repo="@protobuf_git//", bind=True): |
197 |
| - BUILD = """ |
198 |
| -# Copyright 2016 Google Inc. All Rights Reserved. |
199 |
| -# |
200 |
| -# Licensed under the Apache License, Version 2.0 (the "License"); |
201 |
| -# you may not use this file except in compliance with the License. |
202 |
| -# You may obtain a copy of the License at |
203 |
| -# |
204 |
| -# http://www.apache.org/licenses/LICENSE-2.0 |
205 |
| -# |
206 |
| -# Unless required by applicable law or agreed to in writing, software |
207 |
| -# distributed under the License is distributed on an "AS IS" BASIS, |
208 |
| -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
209 |
| -# See the License for the specific language governing permissions and |
210 |
| -# limitations under the License. |
211 |
| -# |
212 |
| -################################################################################ |
213 |
| -# |
214 |
| -
|
215 |
| -licenses(["notice"]) |
216 |
| -
|
217 |
| -load("@protobuf_git//:protobuf.bzl", "cc_proto_library") |
218 |
| -
|
219 |
| -exports_files(glob(["google/**"])) |
220 |
| -
|
221 |
| -cc_proto_library( |
222 |
| - name = "annotations", |
223 |
| - srcs = [ |
224 |
| - "google/api/annotations.proto", |
225 |
| - "google/api/http.proto", |
226 |
| - ], |
227 |
| - include = ".", |
228 |
| - visibility = ["//visibility:public"], |
229 |
| - deps = [ |
230 |
| - "//external:cc_wkt_protos", |
231 |
| - ], |
232 |
| - protoc = "//external:protoc", |
233 |
| - default_runtime = "//external:protobuf", |
234 |
| -) |
235 |
| -
|
236 |
| -cc_proto_library( |
237 |
| - name = "servicecontrol", |
238 |
| - srcs = [ |
239 |
| - "google/api/servicecontrol/v1/check_error.proto", |
240 |
| - "google/api/servicecontrol/v1/distribution.proto", |
241 |
| - "google/api/servicecontrol/v1/log_entry.proto", |
242 |
| - "google/api/servicecontrol/v1/metric_value.proto", |
243 |
| - "google/api/servicecontrol/v1/operation.proto", |
244 |
| - "google/api/servicecontrol/v1/service_controller.proto", |
245 |
| - "google/logging/type/http_request.proto", |
246 |
| - "google/logging/type/log_severity.proto", |
247 |
| - "google/rpc/error_details.proto", |
248 |
| - "google/rpc/status.proto", |
249 |
| - "google/type/money.proto", |
250 |
| - ], |
251 |
| - include = ".", |
252 |
| - visibility = ["//visibility:public"], |
253 |
| - deps = [ |
254 |
| - ":service_config", |
255 |
| - ], |
256 |
| - protoc = "//external:protoc", |
257 |
| - default_runtime = "//external:protobuf", |
258 |
| -) |
259 |
| -
|
260 |
| -cc_proto_library( |
261 |
| - name = "service_config", |
262 |
| - srcs = [ |
263 |
| - "google/api/auth.proto", |
264 |
| - "google/api/backend.proto", |
265 |
| - "google/api/billing.proto", |
266 |
| - "google/api/consumer.proto", |
267 |
| - "google/api/context.proto", |
268 |
| - "google/api/control.proto", |
269 |
| - "google/api/documentation.proto", |
270 |
| - "google/api/endpoint.proto", |
271 |
| - "google/api/label.proto", |
272 |
| - "google/api/log.proto", |
273 |
| - "google/api/logging.proto", |
274 |
| - "google/api/metric.proto", |
275 |
| - "google/api/experimental/experimental.proto", |
276 |
| - "google/api/experimental/authorization_config.proto", |
277 |
| - "google/api/monitored_resource.proto", |
278 |
| - "google/api/monitoring.proto", |
279 |
| - "google/api/quota.proto", |
280 |
| - "google/api/service.proto", |
281 |
| - "google/api/source_info.proto", |
282 |
| - "google/api/system_parameter.proto", |
283 |
| - "google/api/usage.proto", |
284 |
| - ], |
285 |
| - include = ".", |
286 |
| - visibility = ["//visibility:public"], |
287 |
| - deps = [ |
288 |
| - ":annotations", |
289 |
| - "//external:cc_wkt_protos", |
290 |
| - ], |
291 |
| - protoc = "//external:protoc", |
292 |
| - default_runtime = "//external:protobuf", |
293 |
| -) |
294 |
| -
|
295 |
| -cc_proto_library( |
296 |
| - name = "cloud_trace", |
297 |
| - srcs = [ |
298 |
| - "google/devtools/cloudtrace/v1/trace.proto", |
299 |
| - ], |
300 |
| - include = ".", |
301 |
| - default_runtime = "//external:protobuf", |
302 |
| - protoc = "//external:protoc", |
303 |
| - visibility = ["//visibility:public"], |
304 |
| - deps = [ |
305 |
| - ":service_config", |
306 |
| - "//external:cc_wkt_protos", |
307 |
| - ], |
308 |
| -) |
309 |
| -""".format(protobuf_repo) |
310 |
| - |
311 |
| - native.new_git_repository( |
312 |
| - name = "googleapis_git", |
313 |
| - commit = "2fe0050bd2a6d4c6ba798c0311f0b149b8997314", |
314 |
| - remote = "https://github.com/googleapis/googleapis.git", |
315 |
| - build_file_content = BUILD, |
316 |
| - ) |
317 |
| - |
318 |
| - if bind: |
319 |
| - native.bind( |
320 |
| - name = "servicecontrol", |
321 |
| - actual = "@googleapis_git//:servicecontrol", |
322 |
| - ) |
323 |
| - |
324 |
| - native.bind( |
325 |
| - name = "servicecontrol_genproto", |
326 |
| - actual = "@googleapis_git//:servicecontrol_genproto", |
327 |
| - ) |
328 |
| - |
329 |
| - native.bind( |
330 |
| - name = "service_config", |
331 |
| - actual = "@googleapis_git//:service_config", |
332 |
| - ) |
333 |
| - |
334 |
| - native.bind( |
335 |
| - name = "cloud_trace", |
336 |
| - actual = "@googleapis_git//:cloud_trace", |
337 |
| - ) |
338 |
| - |
339 | 17 | def servicecontrol_client_repositories(bind=True):
|
340 |
| - googleapis_repositories(bind=bind) |
341 |
| - |
342 | 18 | native.git_repository(
|
343 | 19 | name = "servicecontrol_client_git",
|
344 | 20 | commit = "e2cc62493ef835b34bca6d6d9951abb690295e85",
|
|
0 commit comments