1package {
2    default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5rust_defaults {
6    name: "libvbmeta_rust.defaults",
7    crate_name: "vbmeta",
8    defaults: ["avf_build_flags_rust"],
9    host_supported: true,
10    srcs: ["src/lib.rs"],
11    edition: "2021",
12    rustlibs: [
13        "libavb_bindgen",
14        "libthiserror",
15    ],
16}
17
18rust_library {
19    name: "libvbmeta_rust",
20    defaults: ["libvbmeta_rust.defaults"],
21    apex_available: [
22        "com.android.virt",
23    ],
24}
25
26rust_test_host {
27    name: "libvbmeta_rust.test",
28    defaults: ["libvbmeta_rust.defaults"],
29    prefer_rlib: true,
30    rustlibs: [
31        "libanyhow",
32        "libtempfile",
33    ],
34    data: [
35        ":avb_testkey_rsa2048",
36        ":avb_testkey_rsa4096",
37        ":avb_testkey_rsa8192",
38        ":test_microdroid_vendor_image",
39        ":test_microdroid_vendor_image_no_rollback_index",
40    ],
41    required: ["avbtool"],
42    test_suites: ["general-tests"],
43    test_options: {
44        unit_test: false,
45    },
46    target: {
47        host: {
48            // TODO(b/204562227): remove once the build does this automatically
49            data: [":avbtool"],
50            data_libs: [
51                "libc++",
52                "libcrypto",
53            ],
54        },
55    },
56}
57