forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_binding.bzl
More file actions
29 lines (27 loc) · 868 Bytes
/
api_binding.bzl
File metadata and controls
29 lines (27 loc) · 868 Bytes
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
def _default_envoy_api_impl(ctx):
ctx.file("WORKSPACE", "")
api_dirs = [
"BUILD",
"bazel",
"envoy",
"examples",
"test",
"tools",
"versioning",
"contrib",
"buf.yaml",
]
for d in api_dirs:
ctx.symlink(ctx.path(ctx.attr.envoy_root).dirname.get_child(ctx.attr.reldir).get_child(d), d)
_default_envoy_api = repository_rule(
implementation = _default_envoy_api_impl,
attrs = {
"envoy_root": attr.label(default = "@envoy//:BUILD"),
"reldir": attr.string(),
},
)
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", reldir = "api")