blob: 471b0cf465dfde850ad7aabadf45c7686c7e5a0a [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",
21 "libfuse_rust",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080022 "liblibc",
Victor Hsieh9d0ab622021-04-26 17:07:02 -070023 "liblog_rust",
Victor Hsiehf393a722021-12-08 13:04:27 -080024 "libnix",
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080025 "libstructopt",
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080026 "libthiserror",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080027 ],
Victor Hsiehb50e0fa2021-06-04 15:09:57 -070028 prefer_rlib: true,
ThiƩbaud Weksteen858a9282021-01-12 12:02:37 +010029 target: {
30 darwin: {
31 enabled: false,
32 },
33 },
Victor Hsieh2445e332021-06-04 16:44:53 -070034 shared_libs: [
35 "libcrypto",
36 "libbinder_rpc_unstable",
37 ],
Victor Hsieh9a0ee7e2021-01-11 15:00:10 -080038 defaults: ["crosvm_defaults"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080039}
40
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080041// TODO(b/172687320): remove once there is a canonical bindgen.
42rust_bindgen {
43 name: "libauthfs_crypto_bindgen",
44 wrapper_src: "src/crypto.hpp",
45 crate_name: "authfs_crypto_bindgen",
46 source_stem: "bindings",
47 shared_libs: [
48 "libcrypto",
49 ],
50 bindgen_flags: ["--size_t-is-usize"],
51 cflags: ["-D BORINGSSL_NO_CXX"],
Victor Hsieh573c6492021-03-11 14:19:18 -080052 apex_available: ["com.android.virt"],
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080053}
54
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080055rust_binary {
56 name: "authfs",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080057 defaults: ["authfs_defaults"],
Victor Hsieh573c6492021-03-11 14:19:18 -080058 apex_available: ["com.android.virt"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080059}
60
Victor Hsiehad46e0b2021-01-25 16:07:38 -080061rust_test {
62 name: "authfs_device_test_src_lib",
63 defaults: ["authfs_defaults"],
Victor Hsiehab293ee2021-01-29 17:28:25 -080064 test_suites: ["device-tests"],
Victor Hsieh85b4f732021-03-09 16:02:14 -080065 data: [":authfs_test_files"],
66}
67
68filegroup {
69 name: "authfs_test_files",
70 srcs: [
71 "testdata/cert.der",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080072 "testdata/input.4k",
Inseob Kimc0886c22021-12-13 17:41:24 +090073 "testdata/input.4k.fsv_meta",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080074 "testdata/input.4k1",
Inseob Kimc0886c22021-12-13 17:41:24 +090075 "testdata/input.4k1.fsv_meta",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080076 "testdata/input.4m",
Inseob Kimc0886c22021-12-13 17:41:24 +090077 "testdata/input.4m.fsv_meta",
78 "testdata/input.4m.fsv_meta.bad_merkle",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080079 ],
Victor Hsiehad46e0b2021-01-25 16:07:38 -080080}
Joel Galensona81194e2021-08-23 13:45:39 -070081
82rust_test {
83 name: "libauthfs_crypto_bindgen_test",
84 srcs: [":libauthfs_crypto_bindgen"],
85 crate_name: "authfs_crypto_bindgen_test",
86 test_suites: ["general-tests"],
87 auto_gen_config: true,
88 clippy_lints: "none",
89 lints: "none",
90}