blob: ef78d4e1d0c28f6ac36561aa4d80fede9f512ba5 [file] [log] [blame]
Bob Badour2efc4762021-02-03 18:36:27 -08001package {
2 default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
Victor Hsieh1fe51c42020-11-05 11:08:10 -08005rust_defaults {
6 name: "authfs_defaults",
7 crate_name: "authfs",
8 srcs: [
Victor Hsieh88ac6ca2020-11-13 15:20:24 -08009 "src/main.rs",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080010 ],
11 edition: "2018",
12 rustlibs: [
Victor Hsiehf01f3232020-12-11 13:31:31 -080013 "authfs_aidl_interface-rust",
Victor Hsieh9d0ab622021-04-26 17:07:02 -070014 "libandroid_logger",
Victor Hsiehec184562020-11-06 13:50:31 -080015 "libanyhow",
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080016 "libauthfs_crypto_bindgen",
Inseob Kimc0886c22021-12-13 17:41:24 +090017 "libauthfs_fsverity_metadata",
Victor Hsieh2445e332021-06-04 16:44:53 -070018 "libbinder_rpc_unstable_bindgen",
19 "libbinder_rs",
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080020 "libcfg_if",
Victor Hsieh99782572022-01-05 15:38:33 -080021 "libfsverity_digests_proto_rust",
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080022 "libfuse_rust",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080023 "liblibc",
Victor Hsieh9d0ab622021-04-26 17:07:02 -070024 "liblog_rust",
Victor Hsiehf393a722021-12-08 13:04:27 -080025 "libnix",
Victor Hsieh99782572022-01-05 15:38:33 -080026 "libprotobuf",
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080027 "libstructopt",
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080028 "libthiserror",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080029 ],
Victor Hsiehb50e0fa2021-06-04 15:09:57 -070030 prefer_rlib: true,
ThiƩbaud Weksteen858a9282021-01-12 12:02:37 +010031 target: {
32 darwin: {
33 enabled: false,
34 },
35 },
Victor Hsieh2445e332021-06-04 16:44:53 -070036 shared_libs: [
37 "libcrypto",
38 "libbinder_rpc_unstable",
39 ],
Victor Hsieh9a0ee7e2021-01-11 15:00:10 -080040 defaults: ["crosvm_defaults"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080041}
42
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080043// TODO(b/172687320): remove once there is a canonical bindgen.
44rust_bindgen {
45 name: "libauthfs_crypto_bindgen",
46 wrapper_src: "src/crypto.hpp",
47 crate_name: "authfs_crypto_bindgen",
48 source_stem: "bindings",
49 shared_libs: [
50 "libcrypto",
51 ],
52 bindgen_flags: ["--size_t-is-usize"],
53 cflags: ["-D BORINGSSL_NO_CXX"],
Victor Hsieh573c6492021-03-11 14:19:18 -080054 apex_available: ["com.android.virt"],
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080055}
56
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080057rust_binary {
58 name: "authfs",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080059 defaults: ["authfs_defaults"],
Victor Hsieh573c6492021-03-11 14:19:18 -080060 apex_available: ["com.android.virt"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080061}
62
Victor Hsiehad46e0b2021-01-25 16:07:38 -080063rust_test {
64 name: "authfs_device_test_src_lib",
65 defaults: ["authfs_defaults"],
Victor Hsiehab293ee2021-01-29 17:28:25 -080066 test_suites: ["device-tests"],
Victor Hsieh85b4f732021-03-09 16:02:14 -080067 data: [":authfs_test_files"],
68}
69
70filegroup {
71 name: "authfs_test_files",
72 srcs: [
73 "testdata/cert.der",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080074 "testdata/input.4k",
Inseob Kimc0886c22021-12-13 17:41:24 +090075 "testdata/input.4k.fsv_meta",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080076 "testdata/input.4k1",
Inseob Kimc0886c22021-12-13 17:41:24 +090077 "testdata/input.4k1.fsv_meta",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080078 "testdata/input.4m",
Inseob Kimc0886c22021-12-13 17:41:24 +090079 "testdata/input.4m.fsv_meta",
80 "testdata/input.4m.fsv_meta.bad_merkle",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080081 ],
Victor Hsiehad46e0b2021-01-25 16:07:38 -080082}
Joel Galensona81194e2021-08-23 13:45:39 -070083
84rust_test {
85 name: "libauthfs_crypto_bindgen_test",
86 srcs: [":libauthfs_crypto_bindgen"],
87 crate_name: "authfs_crypto_bindgen_test",
88 test_suites: ["general-tests"],
89 auto_gen_config: true,
90 clippy_lints: "none",
91 lints: "none",
92}