From 44b1d1deb49671c5646805539e3443e3e9554758 Mon Sep 17 00:00:00 2001 From: Alfred Fuller Date: Thu, 3 Aug 2023 09:36:56 -0700 Subject: [PATCH] Add bazel targets for test protos (#513) So they can be referenced by other repos that use bazel. --- WORKSPACE.bazel | 15 +++++++++ cc/grpc_client_test.cc | 14 ++++++++ proto/connectrpc/conformance/BUILD.bazel | 43 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 proto/connectrpc/conformance/BUILD.bazel diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 06deddb0..b9c51bc7 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -1,9 +1,24 @@ +# Copyright 2022 Buf Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + workspace(name = "com_github_bufbuild_protovalidate") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "com_github_grpc_grpc", + sha256 = "931f07db9d48cff6a6007c1033ba6d691fe655bea2765444bc1ad974dfc840aa", strip_prefix = "grpc-1.56.2", urls = [ "https://github.com/grpc/grpc/archive/v1.56.2.tar.gz", diff --git a/cc/grpc_client_test.cc b/cc/grpc_client_test.cc index e0fd5598..8e39ea0b 100644 --- a/cc/grpc_client_test.cc +++ b/cc/grpc_client_test.cc @@ -1,3 +1,17 @@ +// Copyright 2022 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #include #include diff --git a/proto/connectrpc/conformance/BUILD.bazel b/proto/connectrpc/conformance/BUILD.bazel new file mode 100644 index 00000000..11156b6d --- /dev/null +++ b/proto/connectrpc/conformance/BUILD.bazel @@ -0,0 +1,43 @@ +# Copyright 2022 Buf Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +proto_library( + name = "messages", + srcs = ["messages.proto"], + strip_import_prefix = "/proto", + deps = [ + "@com_google_protobuf//:any_proto", + "@com_google_protobuf//:wrappers_proto", + ], +) + +proto_library( + name = "test", + srcs = ["test.proto"], + strip_import_prefix = "/proto", + deps = [ + ":messages", + "@com_google_protobuf//:empty_proto", + ], +) + +cc_proto_library( + name = "messages_cc_proto", + deps = [":messages"], +) + +cc_proto_library( + name = "test_cc_proto", + deps = [":test"], +)