blob: 16d0b3a3775114716e243e5e059f12f1480ef83d [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 Hsieh88ac6ca2020-11-13 15:20:24 -080017 "libcfg_if",
18 "libfuse_rust",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080019 "liblibc",
Victor Hsieh9d0ab622021-04-26 17:07:02 -070020 "liblog_rust",
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080021 "libstructopt",
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080022 "libthiserror",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080023 ],
Victor Hsiehb50e0fa2021-06-04 15:09:57 -070024 prefer_rlib: true,
ThiƩbaud Weksteen858a9282021-01-12 12:02:37 +010025 target: {
26 darwin: {
27 enabled: false,
28 },
29 },
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080030 shared_libs: ["libcrypto"],
Victor Hsieh9a0ee7e2021-01-11 15:00:10 -080031 defaults: ["crosvm_defaults"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080032}
33
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080034// TODO(b/172687320): remove once there is a canonical bindgen.
35rust_bindgen {
36 name: "libauthfs_crypto_bindgen",
37 wrapper_src: "src/crypto.hpp",
38 crate_name: "authfs_crypto_bindgen",
39 source_stem: "bindings",
40 shared_libs: [
41 "libcrypto",
42 ],
43 bindgen_flags: ["--size_t-is-usize"],
44 cflags: ["-D BORINGSSL_NO_CXX"],
Victor Hsieh573c6492021-03-11 14:19:18 -080045 apex_available: ["com.android.virt"],
Victor Hsiehd1cb0d72020-11-06 13:49:55 -080046}
47
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080048rust_binary {
49 name: "authfs",
Victor Hsieh1fe51c42020-11-05 11:08:10 -080050 defaults: ["authfs_defaults"],
Victor Hsieh573c6492021-03-11 14:19:18 -080051 apex_available: ["com.android.virt"],
Victor Hsieh1fe51c42020-11-05 11:08:10 -080052}
53
Victor Hsiehad46e0b2021-01-25 16:07:38 -080054rust_test {
55 name: "authfs_device_test_src_lib",
56 defaults: ["authfs_defaults"],
Victor Hsiehab293ee2021-01-29 17:28:25 -080057 test_suites: ["device-tests"],
Victor Hsieh85b4f732021-03-09 16:02:14 -080058 data: [":authfs_test_files"],
59}
60
61filegroup {
62 name: "authfs_test_files",
63 srcs: [
64 "testdata/cert.der",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080065 "testdata/input.4k",
66 "testdata/input.4k.fsv_sig",
67 "testdata/input.4k.merkle_dump",
68 "testdata/input.4k1",
69 "testdata/input.4k1.fsv_sig",
70 "testdata/input.4k1.merkle_dump",
71 "testdata/input.4m",
72 "testdata/input.4m.fsv_sig",
73 "testdata/input.4m.merkle_dump",
74 "testdata/input.4m.merkle_dump.bad",
75 ],
Victor Hsiehad46e0b2021-01-25 16:07:38 -080076}