chore: restructure bazel macros

This commit is contained in:
41666 2020-10-15 00:51:53 -04:00
parent a33aa3841c
commit a0b4392b05
54 changed files with 80 additions and 56 deletions

22
hack/bazel/utils.bzl Normal file
View file

@ -0,0 +1,22 @@
def render_deps(deps = []):
output_deps = []
has_added_grpc_deps = False
for dep in deps:
if dep.startswith("//src/rpc"):
output_deps.append(dep + ":ts")
output_deps.append(dep + ":ts_proto")
if has_added_grpc_deps == False:
output_deps.extend([
"@npm//google-protobuf",
"@npm//@types/google-protobuf",
"@npm//@improbable-eng/grpc-web",
])
has_added_grpc_deps = True
elif dep.startswith("//") or dep.startswith("@npm//"):
output_deps.append(dep)
else:
output_deps.append("@npm//" + dep)
return output_deps