blob: 353b597fe17688fac9761e6b1d12fe543349e11c [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",
Victor Hsieh2445e332021-06-04 16:44:53 -070017 "libbinder_rpc_unstable_bindgen",
18 "libbinder_rs",
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080019 "libcfg_if",
20 "libfuse_rust",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080021 "liblibc",
Victor Hsieh9d0ab622021-04-26 17:07:02 -070022 "liblog_rust",
Victor Hsiehf393a722021-12-08 13:04:27 -080023 "libnix",
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080024 "libstructopt",
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080025 "libthiserror",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080026 ],
Victor Hsiehb50e0fa2021-06-04 15:09:57 -070027 prefer_rlib: true,
ThiƩbaud Weksteen858a9282021-01-12 12:02:37 +010028 target: {
29 darwin: {
30 enabled: false,
31 },
32 },
Victor Hsieh2445e332021-06-04 16:44:53 -070033 shared_libs: [
34 "libcrypto",
35 "libbinder_rpc_unstable",
36 ],
Victor Hsieh9a0ee7e2021-01-11 15:00:10 -080037 defaults: ["crosvm_defaults"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080038}
39
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080040// TODO(b/172687320): remove once there is a canonical bindgen.
41rust_bindgen {
42 name: "libauthfs_crypto_bindgen",
43 wrapper_src: "src/crypto.hpp",
44 crate_name: "authfs_crypto_bindgen",
45 source_stem: "bindings",
46 shared_libs: [
47 "libcrypto",
48 ],
49 bindgen_flags: ["--size_t-is-usize"],
50 cflags: ["-D BORINGSSL_NO_CXX"],
Victor Hsieh573c6492021-03-11 14:19:18 -080051 apex_available: ["com.android.virt"],
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080052}
53
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080054rust_binary {
55 name: "authfs",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080056 defaults: ["authfs_defaults"],
Victor Hsieh573c6492021-03-11 14:19:18 -080057 apex_available: ["com.android.virt"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080058}
59
Victor Hsiehad46e0b2021-01-25 16:07:38 -080060rust_test {
61 name: "authfs_device_test_src_lib",
62 defaults: ["authfs_defaults"],
Victor Hsiehab293ee2021-01-29 17:28:25 -080063 test_suites: ["device-tests"],
Victor Hsieh85b4f732021-03-09 16:02:14 -080064 data: [":authfs_test_files"],
65}
66
67filegroup {
68 name: "authfs_test_files",
69 srcs: [
70 "testdata/cert.der",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080071 "testdata/input.4k",
72 "testdata/input.4k.fsv_sig",
73 "testdata/input.4k.merkle_dump",
74 "testdata/input.4k1",
75 "testdata/input.4k1.fsv_sig",
76 "testdata/input.4k1.merkle_dump",
77 "testdata/input.4m",
78 "testdata/input.4m.fsv_sig",
79 "testdata/input.4m.merkle_dump",
80 "testdata/input.4m.merkle_dump.bad",
81 ],
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}