1# Copyright (C) 2023 The Android Open Source Project 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("@rules_rust//rust:defs.bzl", "rust_doc_test", "rust_library", "rust_test") 16 17package( 18 default_visibility = ["//visibility:public"], 19) 20 21rust_library( 22 name = "libstorage", 23 srcs = [ 24 "src/gpt.rs", 25 "src/lib.rs", 26 "src/multi_blocks.rs", 27 "src/non_blocking.rs", 28 ], 29 crate_name = "gbl_storage", 30 edition = "2021", 31 deps = [ 32 "@crc32fast", 33 "@gbl//libsafemath", 34 "@zerocopy", 35 ], 36) 37 38rust_library( 39 name = "libstorage_testlib", 40 srcs = [ 41 "src/testlib.rs", 42 ], 43 crate_name = "gbl_storage_testlib", 44 edition = "2021", 45 deps = [ 46 ":libstorage", 47 "@crc32fast", 48 "@gbl//libsafemath", 49 "@zerocopy", 50 ], 51) 52 53rust_test( 54 name = "libstorage_test", 55 compile_data = ["@gbl//libstorage/test:test_data"], 56 crate = ":libstorage", 57 deps = [ 58 ":libstorage_testlib", 59 ], 60) 61 62rust_test( 63 name = "libstorage_testlib_test", 64 crate = ":libstorage_testlib", 65) 66 67rust_doc_test( 68 name = "libstorage_doc_test", 69 crate = ":libstorage", 70) 71