xref: /aosp_15_r20/bootable/libbootloader/gbl/libstorage/BUILD (revision 5225e6b173e52d2efc6bcf950c27374fd72adabc)
1*5225e6b1SAndroid Build Coastguard Worker# Copyright (C) 2023 The Android Open Source Project
2*5225e6b1SAndroid Build Coastguard Worker#
3*5225e6b1SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
4*5225e6b1SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
5*5225e6b1SAndroid Build Coastguard Worker# You may obtain a copy of the License at
6*5225e6b1SAndroid Build Coastguard Worker#
7*5225e6b1SAndroid Build Coastguard Worker#     http://www.apache.org/licenses/LICENSE-2.0
8*5225e6b1SAndroid Build Coastguard Worker#
9*5225e6b1SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*5225e6b1SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
11*5225e6b1SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*5225e6b1SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
13*5225e6b1SAndroid Build Coastguard Worker# limitations under the License.
14*5225e6b1SAndroid Build Coastguard Worker
15*5225e6b1SAndroid Build Coastguard Workerload("@gbl//toolchain:gbl_workspace_util.bzl", "ANDROID_RUST_LINTS")
16*5225e6b1SAndroid Build Coastguard Workerload("@rules_rust//rust:defs.bzl", "rust_doc_test", "rust_library", "rust_test")
17*5225e6b1SAndroid Build Coastguard Worker
18*5225e6b1SAndroid Build Coastguard Workerpackage(
19*5225e6b1SAndroid Build Coastguard Worker    default_visibility = ["//visibility:public"],
20*5225e6b1SAndroid Build Coastguard Worker)
21*5225e6b1SAndroid Build Coastguard Worker
22*5225e6b1SAndroid Build Coastguard Workerrust_library(
23*5225e6b1SAndroid Build Coastguard Worker    name = "libstorage",
24*5225e6b1SAndroid Build Coastguard Worker    srcs = [
25*5225e6b1SAndroid Build Coastguard Worker        "src/algorithm.rs",
26*5225e6b1SAndroid Build Coastguard Worker        "src/gpt.rs",
27*5225e6b1SAndroid Build Coastguard Worker        "src/lib.rs",
28*5225e6b1SAndroid Build Coastguard Worker        "src/ram_block.rs",
29*5225e6b1SAndroid Build Coastguard Worker    ],
30*5225e6b1SAndroid Build Coastguard Worker    crate_name = "gbl_storage",
31*5225e6b1SAndroid Build Coastguard Worker    edition = "2021",
32*5225e6b1SAndroid Build Coastguard Worker    rustc_flags = ANDROID_RUST_LINTS,
33*5225e6b1SAndroid Build Coastguard Worker    deps = [
34*5225e6b1SAndroid Build Coastguard Worker        "@crc32fast",
35*5225e6b1SAndroid Build Coastguard Worker        "@gbl//libasync",
36*5225e6b1SAndroid Build Coastguard Worker        "@gbl//liberror",
37*5225e6b1SAndroid Build Coastguard Worker        "@gbl//libsafemath",
38*5225e6b1SAndroid Build Coastguard Worker        "@gbl//libutils",
39*5225e6b1SAndroid Build Coastguard Worker        "@zerocopy",
40*5225e6b1SAndroid Build Coastguard Worker    ],
41*5225e6b1SAndroid Build Coastguard Worker)
42*5225e6b1SAndroid Build Coastguard Worker
43*5225e6b1SAndroid Build Coastguard Workerrust_test(
44*5225e6b1SAndroid Build Coastguard Worker    name = "libstorage_test",
45*5225e6b1SAndroid Build Coastguard Worker    compile_data = ["@gbl//libstorage/test:test_data"],
46*5225e6b1SAndroid Build Coastguard Worker    crate = ":libstorage",
47*5225e6b1SAndroid Build Coastguard Worker    rustc_flags = ANDROID_RUST_LINTS,
48*5225e6b1SAndroid Build Coastguard Worker)
49*5225e6b1SAndroid Build Coastguard Worker
50*5225e6b1SAndroid Build Coastguard Workerrust_doc_test(
51*5225e6b1SAndroid Build Coastguard Worker    name = "libstorage_doc_test",
52*5225e6b1SAndroid Build Coastguard Worker    crate = ":libstorage",
53*5225e6b1SAndroid Build Coastguard Worker)
54