|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
load(":envoy_http_archive.bzl", "envoy_http_archive")
|
|
|
|
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS")
|
|
|
|
|
|
|
|
def api_dependencies():
|
|
|
|
envoy_http_archive(
|
|
|
|
"bazel_skylib",
|
|
|
|
locations = REPOSITORY_LOCATIONS,
|
|
|
|
)
|
|
|
|
envoy_http_archive(
|
|
|
|
"com_lyft_protoc_gen_validate",
|
|
|
|
locations = REPOSITORY_LOCATIONS,
|
|
|
|
)
|
|
|
|
envoy_http_archive(
|
|
|
|
name = "googleapis",
|
|
|
|
locations = REPOSITORY_LOCATIONS,
|
|
|
|
build_file_content = GOOGLEAPIS_BUILD_CONTENT,
|
|
|
|
)
|
|
|
|
envoy_http_archive(
|
|
|
|
name = "com_github_gogo_protobuf",
|
|
|
|
locations = REPOSITORY_LOCATIONS,
|
|
|
|
build_file_content = GOGOPROTO_BUILD_CONTENT,
|
|
|
|
)
|
|
|
|
envoy_http_archive(
|
|
|
|
name = "prometheus_metrics_model",
|
|
|
|
locations = REPOSITORY_LOCATIONS,
|
|
|
|
build_file_content = PROMETHEUSMETRICS_BUILD_CONTENT,
|
|
|
|
)
|
|
|
|
envoy_http_archive(
|
|
|
|
name = "io_opencensus_trace",
|
|
|
|
locations = REPOSITORY_LOCATIONS,
|
|
|
|
build_file_content = OPENCENSUSTRACE_BUILD_CONTENT,
|
|
|
|
)
|
|
|
|
|
|
|
|
GOOGLEAPIS_BUILD_CONTENT = """
|
|
|
|
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library", "py_proto_library")
|
|
|
|
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "api_httpbody_protos_src",
|
|
|
|
srcs = [
|
|
|
|
"google/api/httpbody.proto",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "api_httpbody_protos_proto",
|
|
|
|
srcs = [":api_httpbody_protos_src"],
|
|
|
|
deps = ["@com_google_protobuf//:descriptor_proto"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_proto_library(
|
|
|
|
name = "api_httpbody_protos",
|
|
|
|
srcs = [
|
|
|
|
"google/api/httpbody.proto",
|
|
|
|
],
|
|
|
|
default_runtime = "@com_google_protobuf//:protobuf",
|
|
|
|
protoc = "@com_google_protobuf//:protoc",
|
|
|
|
deps = ["@com_google_protobuf//:cc_wkt_protos"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
py_proto_library(
|
|
|
|
name = "api_httpbody_protos_py",
|
|
|
|
srcs = [
|
|
|
|
"google/api/httpbody.proto",
|
|
|
|
],
|
|
|
|
include = ".",
|
|
|
|
default_runtime = "@com_google_protobuf//:protobuf_python",
|
|
|
|
protoc = "@com_google_protobuf//:protoc",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = ["@com_google_protobuf//:protobuf_python"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_proto_library(
|
|
|
|
name = "api_httpbody_go_proto",
|
|
|
|
importpath = "google.golang.org/genproto/googleapis/api/httpbody",
|
|
|
|
proto = ":api_httpbody_protos_proto",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
":descriptor_go_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "http_api_protos_src",
|
|
|
|
srcs = [
|
|
|
|
"google/api/annotations.proto",
|
|
|
|
"google/api/http.proto",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_proto_library(
|
|
|
|
name = "descriptor_go_proto",
|
|
|
|
importpath = "github.com/golang/protobuf/protoc-gen-go/descriptor",
|
|
|
|
proto = "@com_google_protobuf//:descriptor_proto",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "http_api_protos_proto",
|
|
|
|
srcs = [":http_api_protos_src"],
|
|
|
|
deps = ["@com_google_protobuf//:descriptor_proto"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_proto_library(
|
|
|
|
name = "http_api_protos",
|
|
|
|
srcs = [
|
|
|
|
"google/api/annotations.proto",
|
|
|
|
"google/api/http.proto",
|
|
|
|
],
|
|
|
|
default_runtime = "@com_google_protobuf//:protobuf",
|
|
|
|
protoc = "@com_google_protobuf//:protoc",
|
|
|
|
deps = ["@com_google_protobuf//:cc_wkt_protos"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
py_proto_library(
|
|
|
|
name = "http_api_protos_py",
|
|
|
|
srcs = [
|
|
|
|
"google/api/annotations.proto",
|
|
|
|
"google/api/http.proto",
|
|
|
|
],
|
|
|
|
include = ".",
|
|
|
|
default_runtime = "@com_google_protobuf//:protobuf_python",
|
|
|
|
protoc = "@com_google_protobuf//:protoc",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = ["@com_google_protobuf//:protobuf_python"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_proto_library(
|
|
|
|
name = "http_api_go_proto",
|
|
|
|
importpath = "google.golang.org/genproto/googleapis/api/annotations",
|
|
|
|
proto = ":http_api_protos_proto",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
":descriptor_go_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "rpc_status_protos_src",
|
|
|
|
srcs = [
|
|
|
|
"google/rpc/status.proto",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "rpc_status_protos_lib",
|
|
|
|
srcs = [":rpc_status_protos_src"],
|
|
|
|
deps = ["@com_google_protobuf//:any_proto"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_proto_library(
|
|
|
|
name = "rpc_status_protos",
|
|
|
|
srcs = ["google/rpc/status.proto"],
|
|
|
|
default_runtime = "@com_google_protobuf//:protobuf",
|
|
|
|
protoc = "@com_google_protobuf//:protoc",
|
|
|
|
deps = [
|
|
|
|
"@com_google_protobuf//:cc_wkt_protos"
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_proto_library(
|
|
|
|
name = "rpc_status_go_proto",
|
|
|
|
importpath = "google.golang.org/genproto/googleapis/rpc/status",
|
|
|
|
proto = ":rpc_status_protos_lib",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"@com_github_golang_protobuf//ptypes/any:go_default_library",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
py_proto_library(
|
|
|
|
name = "rpc_status_protos_py",
|
|
|
|
srcs = [
|
|
|
|
"google/rpc/status.proto",
|
|
|
|
],
|
|
|
|
include = ".",
|
|
|
|
default_runtime = "@com_google_protobuf//:protobuf_python",
|
|
|
|
protoc = "@com_google_protobuf//:protoc",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = ["@com_google_protobuf//:protobuf_python"],
|
|
|
|
)
|
|
|
|
"""
|
|
|
|
|
|
|
|
GOGOPROTO_BUILD_CONTENT = """
|
|
|
|
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library", "py_proto_library")
|
|
|
|
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "gogo_proto",
|
|
|
|
srcs = [
|
|
|
|
"gogoproto/gogo.proto",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
"@com_google_protobuf//:descriptor_proto",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_proto_library(
|
|
|
|
name = "descriptor_go_proto",
|
|
|
|
importpath = "github.com/golang/protobuf/protoc-gen-go/descriptor",
|
|
|
|
proto = "@com_google_protobuf//:descriptor_proto",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_proto_library(
|
|
|
|
name = "gogo_proto_cc",
|
|
|
|
srcs = [
|
|
|
|
"gogoproto/gogo.proto",
|
|
|
|
],
|
|
|
|
default_runtime = "@com_google_protobuf//:protobuf",
|
|
|
|
protoc = "@com_google_protobuf//:protoc",
|
|
|
|
deps = ["@com_google_protobuf//:cc_wkt_protos"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_proto_library(
|
|
|
|
name = "gogo_proto_go",
|
|
|
|
importpath = "gogoproto",
|
|
|
|
proto = ":gogo_proto",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
":descriptor_go_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
py_proto_library(
|
|
|
|
name = "gogo_proto_py",
|
|
|
|
srcs = [
|
|
|
|
"gogoproto/gogo.proto",
|
|
|
|
],
|
|
|
|
default_runtime = "@com_google_protobuf//:protobuf_python",
|
|
|
|
protoc = "@com_google_protobuf//:protoc",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = ["@com_google_protobuf//:protobuf_python"],
|
|
|
|
)
|
|
|
|
"""
|
|
|
|
|
|
|
|
PROMETHEUSMETRICS_BUILD_CONTENT = """
|
|
|
|
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library")
|
|
|
|
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
|
|
|
|
|
|
|
api_proto_library(
|
|
|
|
name = "client_model",
|
|
|
|
srcs = [
|
|
|
|
"metrics.proto",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_proto_library(
|
|
|
|
name = "client_model_go_proto",
|
|
|
|
importpath = "client_model",
|
|
|
|
proto = ":client_model",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
"""
|
|
|
|
|
|
|
|
OPENCENSUSTRACE_BUILD_CONTENT = """
|
|
|
|
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library")
|
|
|
|
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
|
|
|
|
|
|
|
api_proto_library(
|
|
|
|
name = "trace_model",
|
|
|
|
srcs = [
|
|
|
|
"trace.proto",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_proto_library(
|
|
|
|
name = "trace_model_go_proto",
|
|
|
|
importpath = "trace_model",
|
|
|
|
proto = ":trace_model",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
"""
|