bazel: various fixes to assist the Google import. (#99)

pull/101/head
htuch 8 years ago committed by GitHub
parent abcd5ba14a
commit 422332bf5f
  1. 2
      api/BUILD
  2. 2
      api/filter/BUILD
  3. 2
      api/rlds.proto
  4. 21
      bazel/api_build_system.bzl
  5. 8
      test/build/BUILD

@ -1,5 +1,7 @@
load("//bazel:api_build_system.bzl", "api_proto_library")
licenses(["notice"]) # Apache 2
api_proto_library(
name = "accesslog",
srcs = ["accesslog.proto"],

@ -1,5 +1,7 @@
load("//bazel:api_build_system.bzl", "api_proto_library")
licenses(["notice"]) # Apache 2
api_proto_library(
name = "http_connection_manager",
srcs = ["http_connection_manager.proto"],

@ -1,7 +1,5 @@
syntax = "proto3";
option go_package = "ratelimit";
package envoy.api.v2;
service RateLimitDiscoveryService {

@ -1,5 +1,11 @@
load("@protobuf_bzl//:protobuf.bzl", "cc_proto_library", "py_proto_library")
def _CcSuffix(d):
return d + "_cc"
def _PySuffix(d):
return d + "_py"
# TODO(htuch): has_services is currently ignored but will in future support
# gRPC stub generation.
def api_cc_proto_library(name, srcs = [], deps = [], has_services = 0):
@ -8,7 +14,7 @@ def api_cc_proto_library(name, srcs = [], deps = [], has_services = 0):
srcs = srcs,
default_runtime = "//external:protobuf",
protoc = "//external:protoc",
deps = deps + [
deps = [_CcSuffix(d) for d in deps] + [
"@googleapis//:http_api_protos",
"@protobuf_bzl//:cc_wkt_protos",
],
@ -23,10 +29,17 @@ def api_py_proto_library(name, srcs = [], deps = [], has_services = 0):
srcs = srcs,
default_runtime = "//external:protobuf_python",
protoc = "//external:protoc",
deps = [d + "_py" for d in deps] + ["@googleapis//:http_api_protos_py"],
deps = [_PySuffix(d) for d in deps] + ["@googleapis//:http_api_protos_py"],
visibility = ["//visibility:public"],
)
def api_proto_library(name, srcs = [], deps = [], has_services = 0):
api_cc_proto_library(name, srcs, deps, has_services)
api_py_proto_library(name + "_py", srcs, deps, has_services)
api_cc_proto_library(_CcSuffix(name), srcs, deps, has_services)
api_py_proto_library(_PySuffix(name), srcs, deps, has_services)
def api_cc_test(name, srcs, proto_deps):
native.cc_test(
name = name,
srcs = srcs,
deps = [_CcSuffix(d) for d in proto_deps],
)

@ -1,7 +1,11 @@
cc_test(
load("//bazel:api_build_system.bzl", "api_cc_test")
licenses(["notice"]) # Apache 2
api_cc_test(
name = "build_test",
srcs = ["build_test.cc"],
deps = [
proto_deps = [
"//api:cds",
"//api:eds",
"//api:hds",

Loading…
Cancel
Save