1"""External dependencies for grpc-java."""
2
3def grpc_java_repositories(
4        omit_com_google_api_grpc_google_common_protos = False,
5        omit_com_google_auth_google_auth_library_credentials = False,
6        omit_com_google_auth_google_auth_library_oauth2_http = False,
7        omit_com_google_code_findbugs_jsr305 = False,
8        omit_com_google_code_gson = False,
9        omit_com_google_errorprone_error_prone_annotations = False,
10        omit_com_google_guava = False,
11        omit_com_google_protobuf = False,
12        omit_com_google_protobuf_java = False,
13        omit_com_google_protobuf_javalite = False,
14        omit_com_google_protobuf_nano_protobuf_javanano = False,
15        omit_com_google_re2j = False,
16        omit_com_google_truth_truth = False,
17        omit_com_squareup_okhttp = False,
18        omit_com_squareup_okio = False,
19        omit_io_netty_buffer = False,
20        omit_io_netty_common = False,
21        omit_io_netty_transport = False,
22        omit_io_netty_codec = False,
23        omit_io_netty_codec_socks = False,
24        omit_io_netty_codec_http = False,
25        omit_io_netty_codec_http2 = False,
26        omit_io_netty_handler = False,
27        omit_io_netty_handler_proxy = False,
28        omit_io_netty_resolver = False,
29        omit_io_netty_tcnative_boringssl_static = False,
30        omit_io_opencensus_api = False,
31        omit_io_opencensus_grpc_metrics = False,
32        omit_javax_annotation = False,
33        omit_junit_junit = False,
34        omit_org_apache_commons_lang3 = False,
35        omit_org_codehaus_mojo_animal_sniffer_annotations = False):
36    """Imports dependencies for grpc-java."""
37    if not omit_com_google_api_grpc_google_common_protos:
38        com_google_api_grpc_google_common_protos()
39    if not omit_com_google_auth_google_auth_library_credentials:
40        com_google_auth_google_auth_library_credentials()
41    if not omit_com_google_auth_google_auth_library_oauth2_http:
42        com_google_auth_google_auth_library_oauth2_http()
43    if not omit_com_google_code_findbugs_jsr305:
44        com_google_code_findbugs_jsr305()
45    if not omit_com_google_code_gson:
46        com_google_code_gson()
47    if not omit_com_google_errorprone_error_prone_annotations:
48        com_google_errorprone_error_prone_annotations()
49    if not omit_com_google_guava:
50        com_google_guava()
51    if not omit_com_google_protobuf:
52        com_google_protobuf()
53    if omit_com_google_protobuf_java:
54        fail("omit_com_google_protobuf_java is no longer supported and must be not be passed to grpc_java_repositories()")
55    if not omit_com_google_protobuf_javalite:
56        com_google_protobuf_javalite()
57    if not omit_com_google_protobuf_nano_protobuf_javanano:
58        com_google_protobuf_nano_protobuf_javanano()
59    if not omit_com_google_re2j:
60        com_google_re2j()
61    if not omit_com_google_truth_truth:
62        com_google_truth_truth()
63    if not omit_com_squareup_okhttp:
64        com_squareup_okhttp()
65    if not omit_com_squareup_okio:
66        com_squareup_okio()
67    if not omit_io_netty_buffer:
68        io_netty_buffer()
69    if not omit_io_netty_common:
70        io_netty_common()
71    if not omit_io_netty_transport:
72        io_netty_transport()
73    if not omit_io_netty_codec:
74        io_netty_codec()
75    if not omit_io_netty_codec_socks:
76        io_netty_codec_socks()
77    if not omit_io_netty_codec_http:
78        io_netty_codec_http()
79    if not omit_io_netty_codec_http2:
80        io_netty_codec_http2()
81    if not omit_io_netty_handler:
82        io_netty_handler()
83    if not omit_io_netty_handler_proxy:
84        io_netty_handler_proxy()
85    if not omit_io_netty_resolver:
86        io_netty_resolver()
87    if not omit_io_netty_tcnative_boringssl_static:
88        io_netty_tcnative_boringssl_static()
89    if not omit_io_opencensus_api:
90        io_opencensus_api()
91    if not omit_io_opencensus_grpc_metrics:
92        io_opencensus_grpc_metrics()
93    if not omit_javax_annotation:
94        javax_annotation()
95    if not omit_junit_junit:
96        junit_junit()
97    if not omit_org_apache_commons_lang3:
98        org_apache_commons_lang3()
99    if not omit_org_codehaus_mojo_animal_sniffer_annotations:
100        org_codehaus_mojo_animal_sniffer_annotations()
101
102    native.bind(
103        name = "guava",
104        actual = "@com_google_guava_guava//jar",
105    )
106    native.bind(
107        name = "gson",
108        actual = "@com_google_code_gson_gson//jar",
109    )
110
111def com_google_api_grpc_google_common_protos():
112    native.maven_jar(
113        name = "com_google_api_grpc_proto_google_common_protos",
114        artifact = "com.google.api.grpc:proto-google-common-protos:1.0.0",
115        sha1 = "86f070507e28b930e50d218ee5b6788ef0dd05e6",
116    )
117
118def com_google_auth_google_auth_library_credentials():
119    native.maven_jar(
120        name = "com_google_auth_google_auth_library_credentials",
121        artifact = "com.google.auth:google-auth-library-credentials:0.9.0",
122        sha1 = "8e2b181feff6005c9cbc6f5c1c1e2d3ec9138d46",
123    )
124
125def com_google_auth_google_auth_library_oauth2_http():
126    native.maven_jar(
127        name = "com_google_auth_google_auth_library_oauth2_http",
128        artifact = "com.google.auth:google-auth-library-oauth2-http:0.9.0",
129        sha1 = "04e6152c3aead24148627e84f5651e79698c00d9",
130    )
131
132def com_google_code_findbugs_jsr305():
133    native.maven_jar(
134        name = "com_google_code_findbugs_jsr305",
135        artifact = "com.google.code.findbugs:jsr305:3.0.2",
136        sha1 = "25ea2e8b0c338a877313bd4672d3fe056ea78f0d",
137    )
138
139def com_google_code_gson():
140    native.maven_jar(
141        name = "com_google_code_gson_gson",
142        artifact = "com.google.code.gson:gson:jar:2.7",
143        sha1 = "751f548c85fa49f330cecbb1875893f971b33c4e",
144    )
145
146def com_google_errorprone_error_prone_annotations():
147    native.maven_jar(
148        name = "com_google_errorprone_error_prone_annotations",
149        artifact = "com.google.errorprone:error_prone_annotations:2.2.0",
150        sha1 = "88e3c593e9b3586e1c6177f89267da6fc6986f0c",
151    )
152
153def com_google_guava():
154    native.maven_jar(
155        name = "com_google_guava_guava",
156        artifact = "com.google.guava:guava:26.0-android",
157        sha1 = "ef69663836b339db335fde0df06fb3cd84e3742b",
158    )
159
160def com_google_protobuf():
161    # proto_library rules implicitly depend on @com_google_protobuf//:protoc,
162    # which is the proto-compiler.
163    # This statement defines the @com_google_protobuf repo.
164    native.http_archive(
165        name = "com_google_protobuf",
166        sha256 = "1f8b9b202e9a4e467ff0b0f25facb1642727cdf5e69092038f15b37c75b99e45",
167        strip_prefix = "protobuf-3.5.1",
168        urls = ["https://github.com/google/protobuf/archive/v3.5.1.zip"],
169    )
170
171def com_google_protobuf_javalite():
172    # java_lite_proto_library rules implicitly depend on @com_google_protobuf_javalite
173    native.http_archive(
174        name = "com_google_protobuf_javalite",
175        sha256 = "d8a2fed3708781196f92e1e7e7e713cf66804bd2944894401057214aff4f468e",
176        strip_prefix = "protobuf-5e8916e881c573c5d83980197a6f783c132d4276",
177        urls = ["https://github.com/google/protobuf/archive/5e8916e881c573c5d83980197a6f783c132d4276.zip"],
178    )
179
180def com_google_protobuf_nano_protobuf_javanano():
181    native.maven_jar(
182        name = "com_google_protobuf_nano_protobuf_javanano",
183        artifact = "com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5",
184        sha1 = "357e60f95cebb87c72151e49ba1f570d899734f8",
185    )
186
187def com_google_re2j():
188    native.maven_jar(
189        name = "com_google_re2j",
190        artifact = "com.google.re2j:re2j:1.2",
191        sha1 = "499d5e041f962fefd0f245a9325e8125608ebb54",
192    )
193
194def com_google_truth_truth():
195    native.maven_jar(
196        name = "com_google_truth_truth",
197        artifact = "com.google.truth:truth:0.42",
198        sha1 = "b5768f644b114e6cf5c3962c2ebcb072f788dcbb",
199    )
200
201def com_squareup_okhttp():
202    native.maven_jar(
203        name = "com_squareup_okhttp_okhttp",
204        artifact = "com.squareup.okhttp:okhttp:2.5.0",
205        sha1 = "4de2b4ed3445c37ec1720a7d214712e845a24636",
206    )
207
208def com_squareup_okio():
209    native.maven_jar(
210        name = "com_squareup_okio_okio",
211        artifact = "com.squareup.okio:okio:1.13.0",
212        sha1 = "a9283170b7305c8d92d25aff02a6ab7e45d06cbe",
213    )
214
215def io_netty_buffer():
216    native.maven_jar(
217        name = "io_netty_netty_buffer",
218        artifact = "io.netty:netty-buffer:4.1.30.Final",
219        sha1 = "597adb653306470fb3ec1af3c0f3f30a37b1310a",
220    )
221
222def io_netty_codec():
223    native.maven_jar(
224        name = "io_netty_netty_codec",
225        artifact = "io.netty:netty-codec:4.1.30.Final",
226        sha1 = "515c8f609aaca28a94f984d89a9667dd3359c1b1",
227    )
228
229def io_netty_codec_http():
230    native.maven_jar(
231        name = "io_netty_netty_codec_http",
232        artifact = "io.netty:netty-codec-http:4.1.30.Final",
233        sha1 = "1384c630e8a0eeef33ad12a28791dce6e1d8767c",
234    )
235
236def io_netty_codec_http2():
237    native.maven_jar(
238        name = "io_netty_netty_codec_http2",
239        artifact = "io.netty:netty-codec-http2:4.1.30.Final",
240        sha1 = "2da92f518409904954d3e8dcc42eb6a562a70302",
241    )
242
243def io_netty_codec_socks():
244    native.maven_jar(
245        name = "io_netty_netty_codec_socks",
246        artifact = "io.netty:netty-codec-socks:4.1.30.Final",
247        sha1 = "ea272e3bb281d3a91d27278f47e61b4de285cc27",
248    )
249
250def io_netty_common():
251    native.maven_jar(
252        name = "io_netty_netty_common",
253        artifact = "io.netty:netty-common:4.1.30.Final",
254        sha1 = "5dca0c34d8f38af51a2398614e81888f51cf811a",
255    )
256
257def io_netty_handler():
258    native.maven_jar(
259        name = "io_netty_netty_handler",
260        artifact = "io.netty:netty-handler:4.1.30.Final",
261        sha1 = "ecc076332ed103411347f4806a44ee32d9d9cb5f",
262    )
263
264def io_netty_handler_proxy():
265    native.maven_jar(
266        name = "io_netty_netty_handler_proxy",
267        artifact = "io.netty:netty-handler-proxy:4.1.30.Final",
268        sha1 = "1baa1568fa936caddca0fae96fdf127fd5cbad16",
269    )
270
271def io_netty_resolver():
272    native.maven_jar(
273        name = "io_netty_netty_resolver",
274        artifact = "io.netty:netty-resolver:4.1.30.Final",
275        sha1 = "5106fd687066ffd712e5295d32af4e2ac6482613",
276    )
277
278def io_netty_tcnative_boringssl_static():
279    native.maven_jar(
280        name = "io_netty_netty_tcnative_boringssl_static",
281        artifact = "io.netty:netty-tcnative-boringssl-static:2.0.17.Final",
282        sha1 = "b1e5acbde8c444c656131238ac6ab9e73f694300",
283    )
284
285def io_netty_transport():
286    native.maven_jar(
287        name = "io_netty_netty_transport",
288        artifact = "io.netty:netty-transport:4.1.30.Final",
289        sha1 = "3d27bb432a3b125167ac161b26415ad29ec17f02",
290    )
291
292def io_opencensus_api():
293    native.maven_jar(
294        name = "io_opencensus_opencensus_api",
295        artifact = "io.opencensus:opencensus-api:0.12.3",
296        sha1 = "743f074095f29aa985517299545e72cc99c87de0",
297    )
298
299def io_opencensus_grpc_metrics():
300    native.maven_jar(
301        name = "io_opencensus_opencensus_contrib_grpc_metrics",
302        artifact = "io.opencensus:opencensus-contrib-grpc-metrics:0.12.3",
303        sha1 = "a4c7ff238a91b901c8b459889b6d0d7a9d889b4d",
304    )
305
306def javax_annotation():
307    # Use //stub:javax_annotation for neverlink=1 support.
308    native.maven_jar(
309        name = "javax_annotation_javax_annotation_api",
310        artifact = "javax.annotation:javax.annotation-api:1.2",
311        sha1 = "479c1e06db31c432330183f5cae684163f186146",
312    )
313
314def junit_junit():
315    native.maven_jar(
316        name = "junit_junit",
317        artifact = "junit:junit:4.12",
318        sha1 = "2973d150c0dc1fefe998f834810d68f278ea58ec",
319    )
320
321def org_apache_commons_lang3():
322    native.maven_jar(
323        name = "org_apache_commons_commons_lang3",
324        artifact = "org.apache.commons:commons-lang3:3.5",
325        sha1 = "6c6c702c89bfff3cd9e80b04d668c5e190d588c6",
326    )
327
328def org_codehaus_mojo_animal_sniffer_annotations():
329    native.maven_jar(
330        name = "org_codehaus_mojo_animal_sniffer_annotations",
331        artifact = "org.codehaus.mojo:animal-sniffer-annotations:1.17",
332        sha1 = "f97ce6decaea32b36101e37979f8b647f00681fb",
333    )
334