blob: a6792b0242d032e66da49a967e058aeef90ffc2e [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 Hsieh88ac6ca2020-11-13 15:20:24 -080023 "libstructopt",
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080024 "libthiserror",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080025 ],
Victor Hsiehb50e0fa2021-06-04 15:09:57 -070026 prefer_rlib: true,
ThiƩbaud Weksteen858a9282021-01-12 12:02:37 +010027 target: {
28 darwin: {
29 enabled: false,
30 },
31 },
Victor Hsieh2445e332021-06-04 16:44:53 -070032 shared_libs: [
33 "libcrypto",
34 "libbinder_rpc_unstable",
35 ],
Victor Hsieh9a0ee7e2021-01-11 15:00:10 -080036 defaults: ["crosvm_defaults"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080037}
38
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080039// TODO(b/172687320): remove once there is a canonical bindgen.
40rust_bindgen {
41 name: "libauthfs_crypto_bindgen",
42 wrapper_src: "src/crypto.hpp",
43 crate_name: "authfs_crypto_bindgen",
44 source_stem: "bindings",
45 shared_libs: [
46 "libcrypto",
47 ],
48 bindgen_flags: ["--size_t-is-usize"],
49 cflags: ["-D BORINGSSL_NO_CXX"],
Victor Hsieh573c6492021-03-11 14:19:18 -080050 apex_available: ["com.android.virt"],
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080051}
52
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080053rust_binary {
54 name: "authfs",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080055 defaults: ["authfs_defaults"],
Victor Hsieh573c6492021-03-11 14:19:18 -080056 apex_available: ["com.android.virt"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080057}
58
Victor Hsiehad46e0b2021-01-25 16:07:38 -080059rust_test {
60 name: "authfs_device_test_src_lib",
61 defaults: ["authfs_defaults"],
Victor Hsiehab293ee2021-01-29 17:28:25 -080062 test_suites: ["device-tests"],
Victor Hsieh85b4f732021-03-09 16:02:14 -080063 data: [":authfs_test_files"],
64}
65
66filegroup {
67 name: "authfs_test_files",
68 srcs: [
69 "testdata/cert.der",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080070 "testdata/input.4k",
71 "testdata/input.4k.fsv_sig",
72 "testdata/input.4k.merkle_dump",
73 "testdata/input.4k1",
74 "testdata/input.4k1.fsv_sig",
75 "testdata/input.4k1.merkle_dump",
76 "testdata/input.4m",
77 "testdata/input.4m.fsv_sig",
78 "testdata/input.4m.merkle_dump",
79 "testdata/input.4m.merkle_dump.bad",
80 ],
Victor Hsiehad46e0b2021-01-25 16:07:38 -080081}
Joel Galensona81194e2021-08-23 13:45:39 -070082
83rust_test {
84 name: "libauthfs_crypto_bindgen_test",
85 srcs: [":libauthfs_crypto_bindgen"],
86 crate_name: "authfs_crypto_bindgen_test",
87 test_suites: ["general-tests"],
88 auto_gen_config: true,
89 clippy_lints: "none",
90 lints: "none",
91}