1# Copyright 2021 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. 14 15load("@rules_python//python:proto.bzl", "py_proto_library") 16load( 17 "//pw_build:pigweed.bzl", 18 "pw_cc_test", 19) 20load("//pw_protobuf_compiler:pw_proto_library.bzl", "pw_proto_library") 21 22package(default_visibility = ["//visibility:public"]) 23 24licenses(["notice"]) 25 26proto_library( 27 name = "file_proto", 28 srcs = ["file.proto"], 29 deps = [ 30 "//pw_protobuf:common_proto", 31 ], 32) 33 34pw_proto_library( 35 name = "file_cc_proto", 36 deps = [ 37 ":file_proto", 38 "//pw_protobuf:common_proto", 39 ], 40) 41 42py_proto_library( 43 name = "file_proto_py_pb2", 44 deps = [":file_proto"], 45) 46 47cc_library( 48 name = "flat_file_system", 49 srcs = [ 50 "flat_file_system.cc", 51 ], 52 hdrs = [ 53 "public/pw_file/flat_file_system.h", 54 ], 55 includes = ["public"], 56 deps = [ 57 ":file_cc_proto.pwpb", 58 ":file_cc_proto.raw_rpc", 59 "//pw_bytes", 60 "//pw_result", 61 "//pw_rpc/raw:server_api", 62 "//pw_status", 63 ], 64) 65 66pw_cc_test( 67 name = "flat_file_system_test", 68 srcs = [ 69 "flat_file_system_test.cc", 70 ], 71 deps = [ 72 ":file_cc_proto.pwpb", 73 ":flat_file_system", 74 "//pw_bytes", 75 "//pw_protobuf", 76 "//pw_rpc/raw:test_method_context", 77 "//pw_status", 78 ], 79) 80