1# Copyright 2020 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14load("@rules_proto//proto:defs.bzl", "proto_library") 15load("@rules_python//python:proto.bzl", "py_proto_library") 16load("//pw_build:pigweed.bzl", "pw_cc_test") 17load("//pw_protobuf_compiler:pw_proto_library.bzl", "nanopb_proto_library", "pw_proto_library") 18 19package(default_visibility = ["//visibility:public"]) 20 21licenses(["notice"]) 22 23pw_cc_test( 24 name = "nanopb_test", 25 srcs = ["nanopb_test.cc"], 26 # TODO: https://pwbug.dev/328311416 - Fix this test. 27 tags = ["manual"], 28 deps = [ 29 ":pw_protobuf_compiler_nanopb_protos_nanopb", 30 "//pw_unit_test", 31 ], 32) 33 34pw_cc_test( 35 name = "pwpb_test", 36 srcs = ["pwpb_test.cc"], 37 deps = [ 38 "//pw_protobuf_compiler/pwpb_test_protos:pwpb_test_pw_proto.pwpb", 39 "//pw_string", 40 "//pw_unit_test", 41 ], 42) 43 44proto_library( 45 name = "pwpb_test_proto_no_prefix", 46 srcs = ["pwpb_no_prefix_test_protos/pwpb_test_no_prefix.proto"], 47 strip_import_prefix = "/pw_protobuf_compiler/pwpb_no_prefix_test_protos", 48 deps = [ 49 "//pw_protobuf:field_options_proto", 50 ], 51) 52 53pw_proto_library( 54 name = "pwpb_test_pw_proto_no_prefix", 55 deps = [ 56 ":pwpb_test_proto_no_prefix", 57 ], 58) 59 60pw_cc_test( 61 name = "pwpb_test_no_prefix", 62 srcs = ["pwpb_test_no_prefix.cc"], 63 deps = [ 64 ":pwpb_test_pw_proto_no_prefix.pwpb", 65 "//pw_string", 66 "//pw_unit_test", 67 ], 68) 69 70py_proto_library( 71 name = "pw_protobuf_compiler_protos_py_pb2", 72 deps = [":pw_protobuf_compiler_protos"], 73) 74 75proto_library( 76 name = "pw_protobuf_compiler_protos", 77 srcs = [ 78 "pw_protobuf_compiler_protos/nested/more_nesting/test.proto", 79 "pw_protobuf_compiler_protos/test.proto", 80 ], 81 strip_import_prefix = "/pw_protobuf_compiler", 82) 83 84proto_library( 85 name = "pw_protobuf_compiler_nanopb_protos", 86 srcs = ["nanopb_test_protos/nanopb_test.proto"], 87 deps = ["@com_github_nanopb_nanopb//:nanopb_proto"], 88) 89 90nanopb_proto_library( 91 name = "pw_protobuf_compiler_nanopb_protos_nanopb", 92 deps = [":pw_protobuf_compiler_nanopb_protos"], 93) 94 95py_proto_library( 96 name = "pw_protobuf_compiler_nanopb_protos_py_pb2", 97 deps = [":pw_protobuf_compiler_nanopb_protos"], 98) 99 100pw_cc_test( 101 name = "nested_packages_test", 102 srcs = ["nested_packages_test.cc"], 103 deps = [ 104 "//pw_protobuf_compiler/pw_nested_packages:aggregate_pw_proto.pwpb", 105 "//pw_protobuf_compiler/pw_nested_packages:aggregate_wrapper_pw_proto.pwpb", 106 "//pw_protobuf_compiler/pw_nested_packages/data_type/id:id_pw_proto.pwpb", 107 "//pw_protobuf_compiler/pw_nested_packages/data_type/thing:thing_pw_proto.pwpb", 108 "//pw_protobuf_compiler/pw_nested_packages/data_type/thing:type_of_thing_pw_proto.pwpb", 109 "//pw_unit_test", 110 ], 111) 112