format: run buildifier on .bzl files. (#3824)

Risk Level: n/a
Testing: ./tools/check_format.py fix
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ df7a2918dbb71136018a1fdd92a0794b584afb3d
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent faa06cebd8
commit b163ae9580
  1. 37
      bazel/api_build_system.bzl
  2. 8
      bazel/repositories.bzl

@ -1,23 +1,22 @@
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
load("@com_lyft_protoc_gen_validate//bazel:pgv_proto_library.bzl", "pgv_cc_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library", "go_grpc_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_grpc_library", "go_proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_test")
_PY_SUFFIX="_py"
_CC_SUFFIX="_cc"
_GO_PROTO_SUFFIX="_go_proto"
_GO_GRPC_SUFFIX="_go_grpc"
_GO_IMPORTPATH_PREFIX="github.com/envoyproxy/data-plane-api/api/"
_PY_SUFFIX = "_py"
_CC_SUFFIX = "_cc"
_GO_PROTO_SUFFIX = "_go_proto"
_GO_GRPC_SUFFIX = "_go_grpc"
_GO_IMPORTPATH_PREFIX = "github.com/envoyproxy/data-plane-api/api/"
def _Suffix(d, suffix):
return d + suffix
return d + suffix
def _LibrarySuffix(library_name, suffix):
# Transform //a/b/c to //a/b/c:c in preparation for suffix operation below.
if library_name.startswith("//") and ":" not in library_name:
library_name += ":" + Label(library_name).name
return _Suffix(library_name, suffix)
# Transform //a/b/c to //a/b/c:c in preparation for suffix operation below.
if library_name.startswith("//") and ":" not in library_name:
library_name += ":" + Label(library_name).name
return _Suffix(library_name, suffix)
# TODO(htuch): has_services is currently ignored but will in future support
# gRPC stub generation.
@ -54,7 +53,7 @@ def api_go_proto_library(name, proto, deps = []):
"@com_github_golang_protobuf//ptypes/any:go_default_library",
"@com_lyft_protoc_gen_validate//validate:go_default_library",
"@googleapis//:rpc_status_go_proto",
]
],
)
def api_go_grpc_library(name, proto, deps = []):
@ -71,19 +70,18 @@ def api_go_grpc_library(name, proto, deps = []):
"@com_github_golang_protobuf//ptypes/any:go_default_library",
"@com_lyft_protoc_gen_validate//validate:go_default_library",
"@googleapis//:http_api_go_proto",
]
],
)
# This is api_proto_library plus some logic internal to //envoy/api.
def api_proto_library_internal(visibility = ["//visibility:private"], **kwargs):
# //envoy/docs/build.sh needs visibility in order to generate documents.
if visibility == ["//visibility:private"]:
visibility = ["//docs"]
visibility = ["//docs"]
elif visibility != ["//visibility:public"]:
visibility = visibility + ["//docs"]
api_proto_library(visibility=visibility, **kwargs)
visibility = visibility + ["//docs"]
api_proto_library(visibility = visibility, **kwargs)
# TODO(htuch): has_services is currently ignored but will in future support
# gRPC stub generation.
@ -115,6 +113,7 @@ def api_proto_library(name, visibility = ["//visibility:private"], srcs = [], de
],
visibility = visibility,
)
# Under the hood, this is just an extension of the Protobuf library's
# bespoke cc_proto_library. It doesn't consume proto_library as a proto
# provider. Hopefully one day we can move to a model where this target and
@ -132,7 +131,7 @@ def api_proto_library(name, visibility = ["//visibility:private"], srcs = [], de
visibility = ["//visibility:public"],
)
if (require_py == 1):
api_py_proto_library(name, srcs, deps, has_services)
api_py_proto_library(name, srcs, deps, has_services)
def api_cc_test(name, srcs, proto_deps):
native.cc_test(

@ -1,7 +1,7 @@
GOOGLEAPIS_SHA = "d642131a6e6582fc226caf9893cb7fe7885b3411" # May 23, 2018
GOGOPROTO_SHA = "1adfc126b41513cc696b209667c8656ea7aac67c" # v1.0.0
PROMETHEUS_SHA = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c" # Nov 17, 2017
OPENCENSUS_SHA = "ab82e5fdec8267dc2a726544b10af97675970847" # May 23, 2018
GOOGLEAPIS_SHA = "d642131a6e6582fc226caf9893cb7fe7885b3411" # May 23, 2018
GOGOPROTO_SHA = "1adfc126b41513cc696b209667c8656ea7aac67c" # v1.0.0
PROMETHEUS_SHA = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c" # Nov 17, 2017
OPENCENSUS_SHA = "ab82e5fdec8267dc2a726544b10af97675970847" # May 23, 2018
PGV_GIT_SHA = "f9d2b11e44149635b23a002693b76512b01ae515"

Loading…
Cancel
Save