1# Copyright 2022 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://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, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15load("//fcp:config.bzl", "FCP_COPTS") 16load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_proto_library") 17 18package( 19 default_visibility = [ 20 "//fcp:internal", 21 ], 22 licenses = ["notice"], # Apache 2.0 23) 24 25proto_library( 26 name = "dictionary_proto", 27 srcs = ["dictionary.proto"], 28) 29 30cc_proto_library( 31 name = "dictionary_cc_proto", 32 deps = [":dictionary_proto"], 33) 34 35py_proto_library( 36 name = "dictionary_py_pb2", 37 deps = [":dictionary_proto"], 38) 39 40cc_library( 41 name = "dictionary_lib", 42 srcs = ["dictionary.cc"], 43 hdrs = ["dictionary.h"], 44 copts = FCP_COPTS, 45 deps = [ 46 ":dictionary_cc_proto", 47 "//fcp/base", 48 "@com_google_absl//absl/container:node_hash_map", 49 "@com_google_absl//absl/status", 50 "@com_google_absl//absl/status:statusor", 51 "@com_google_absl//absl/strings", 52 ], 53) 54 55cc_test( 56 name = "dictionary_test", 57 srcs = ["dictionary_test.cc"], 58 visibility = ["//visibility:private"], 59 deps = [ 60 ":dictionary_cc_proto", 61 ":dictionary_lib", 62 "//fcp/base", 63 "//fcp/testing:parse_text_proto", 64 "@com_google_absl//absl/status", 65 "@com_google_googletest//:gtest_main", 66 ], 67) 68