forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_binding.bzl
36 lines (33 loc) · 1.13 KB
/
api_binding.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def _default_envoy_api_impl(ctx):
ctx.file("WORKSPACE", "")
ctx.file("BUILD.bazel", "")
api_dirs = [
"bazel",
"docs",
"envoy",
"examples",
"test",
"tools",
]
for d in api_dirs:
ctx.symlink(ctx.path(ctx.attr.envoy_root).dirname.get_child("api").get_child(d), d)
_default_envoy_api = repository_rule(
implementation = _default_envoy_api_impl,
attrs = {
"envoy_root": attr.label(default = "@envoy//:BUILD"),
},
)
def envoy_api_binding():
# Treat the data plane API as an external repo, this simplifies exporting the API to
# https://github.com/envoyproxy/data-plane-api.
if "envoy_api" not in native.existing_rules().keys():
_default_envoy_api(name = "envoy_api")
# TODO(https://github.com/envoyproxy/envoy/issues/7719) need to remove both bindings and use canonical rules
native.bind(
name = "api_httpbody_protos",
actual = "@com_google_googleapis//google/api:httpbody_cc_proto",
)
native.bind(
name = "http_api_protos",
actual = "@com_google_googleapis//google/api:annotations_cc_proto",
)