diff --git a/api/BUILD b/api/BUILD index 91558dc6..023b3e86 100644 --- a/api/BUILD +++ b/api/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"], diff --git a/api/filter/BUILD b/api/filter/BUILD index c09265fa..5f11c6a0 100644 --- a/api/filter/BUILD +++ b/api/filter/BUILD @@ -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"], diff --git a/api/rlds.proto b/api/rlds.proto index 17a062c2..61255d53 100644 --- a/api/rlds.proto +++ b/api/rlds.proto @@ -1,7 +1,5 @@ syntax = "proto3"; -option go_package = "ratelimit"; - package envoy.api.v2; service RateLimitDiscoveryService { diff --git a/bazel/api_build_system.bzl b/bazel/api_build_system.bzl index ae94f61a..99d2b1f2 100644 --- a/bazel/api_build_system.bzl +++ b/bazel/api_build_system.bzl @@ -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], + ) diff --git a/test/build/BUILD b/test/build/BUILD index 681dacc4..05922b63 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -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",