forked from infobloxopen/grpc-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repositories.bzl
49 lines (39 loc) · 1.44 KB
/
repositories.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
37
38
39
40
41
42
43
44
45
46
47
48
49
GOOGLEAPIS_GOOGLE_API_BUILD_CONTENTS = """
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
package(default_visibility = ["//visibility:public"])
proto_library(
name = "api_proto",
srcs = [
"annotations.proto",
"http.proto",
],
deps = ["@com_google_protobuf//:descriptor_proto"],
)
go_proto_library(
name = "api_go_proto",
importpath = "google.golang.org/genproto/googleapis/api/annotations",
proto = ":api_proto",
deps = ["@com_github_golang_protobuf//protoc-gen-go/descriptor:go_default_library"],
)
go_library(
name = "go_default_library",
embed = [":api_go_proto"],
importpath = "google.golang.org/genproto/googleapis/api/annotations",
)
"""
def _googleapis_repository_impl(ctx):
googleapis_commit = "e1c0c726290a55065c0c46a62dacc9372939973b"
ctx.download_and_extract(
url = "https://github.com/googleapis/googleapis/archive/{commit}.tar.gz".format(
commit = googleapis_commit,
),
sha256 = "9508971cb4a7c0fe03bc1bfafbd0abc9654c80b4c70e360a6c534938d06d8fb9",
stripPrefix = "googleapis-{}".format(googleapis_commit),
)
ctx.file("google/api/BUILD.bazel", GOOGLEAPIS_GOOGLE_API_BUILD_CONTENTS)
_googleapis_repository = repository_rule(
implementation = _googleapis_repository_impl,
)
def repositories():
_googleapis_repository(name = "com_github_googleapis_googleapis")