Bob Badour | 2efc476 | 2021-02-03 18:36:27 -0800 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 3 | } |
| 4 | |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 5 | rust_defaults { |
| 6 | name: "authfs_defaults", |
| 7 | crate_name: "authfs", |
| 8 | srcs: [ |
Victor Hsieh | 88ac6ca | 2020-11-13 15:20:24 -0800 | [diff] [blame] | 9 | "src/main.rs", |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 10 | ], |
| 11 | edition: "2018", |
| 12 | rustlibs: [ |
Victor Hsieh | f01f323 | 2020-12-11 13:31:31 -0800 | [diff] [blame] | 13 | "authfs_aidl_interface-rust", |
Victor Hsieh | 9d0ab62 | 2021-04-26 17:07:02 -0700 | [diff] [blame] | 14 | "libandroid_logger", |
Victor Hsieh | ec18456 | 2020-11-06 13:50:31 -0800 | [diff] [blame] | 15 | "libanyhow", |
Victor Hsieh | d1cb0d7 | 2020-11-06 13:49:55 -0800 | [diff] [blame] | 16 | "libauthfs_crypto_bindgen", |
Inseob Kim | c0886c2 | 2021-12-13 17:41:24 +0900 | [diff] [blame] | 17 | "libauthfs_fsverity_metadata", |
Victor Hsieh | 2445e33 | 2021-06-04 16:44:53 -0700 | [diff] [blame] | 18 | "libbinder_rpc_unstable_bindgen", |
| 19 | "libbinder_rs", |
Victor Hsieh | 88ac6ca | 2020-11-13 15:20:24 -0800 | [diff] [blame] | 20 | "libcfg_if", |
| 21 | "libfuse_rust", |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 22 | "liblibc", |
Victor Hsieh | 9d0ab62 | 2021-04-26 17:07:02 -0700 | [diff] [blame] | 23 | "liblog_rust", |
Victor Hsieh | f393a72 | 2021-12-08 13:04:27 -0800 | [diff] [blame] | 24 | "libnix", |
Victor Hsieh | 88ac6ca | 2020-11-13 15:20:24 -0800 | [diff] [blame] | 25 | "libstructopt", |
Victor Hsieh | d1cb0d7 | 2020-11-06 13:49:55 -0800 | [diff] [blame] | 26 | "libthiserror", |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 27 | ], |
Victor Hsieh | b50e0fa | 2021-06-04 15:09:57 -0700 | [diff] [blame] | 28 | prefer_rlib: true, |
ThiƩbaud Weksteen | 858a928 | 2021-01-12 12:02:37 +0100 | [diff] [blame] | 29 | target: { |
| 30 | darwin: { |
| 31 | enabled: false, |
| 32 | }, |
| 33 | }, |
Victor Hsieh | 2445e33 | 2021-06-04 16:44:53 -0700 | [diff] [blame] | 34 | shared_libs: [ |
| 35 | "libcrypto", |
| 36 | "libbinder_rpc_unstable", |
| 37 | ], |
Victor Hsieh | 9a0ee7e | 2021-01-11 15:00:10 -0800 | [diff] [blame] | 38 | defaults: ["crosvm_defaults"], |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 39 | } |
| 40 | |
Victor Hsieh | d1cb0d7 | 2020-11-06 13:49:55 -0800 | [diff] [blame] | 41 | // TODO(b/172687320): remove once there is a canonical bindgen. |
| 42 | rust_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 Hsieh | 573c649 | 2021-03-11 14:19:18 -0800 | [diff] [blame] | 52 | apex_available: ["com.android.virt"], |
Victor Hsieh | d1cb0d7 | 2020-11-06 13:49:55 -0800 | [diff] [blame] | 53 | } |
| 54 | |
Victor Hsieh | 88ac6ca | 2020-11-13 15:20:24 -0800 | [diff] [blame] | 55 | rust_binary { |
| 56 | name: "authfs", |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 57 | defaults: ["authfs_defaults"], |
Victor Hsieh | 573c649 | 2021-03-11 14:19:18 -0800 | [diff] [blame] | 58 | apex_available: ["com.android.virt"], |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 59 | } |
| 60 | |
Victor Hsieh | ad46e0b | 2021-01-25 16:07:38 -0800 | [diff] [blame] | 61 | rust_test { |
| 62 | name: "authfs_device_test_src_lib", |
| 63 | defaults: ["authfs_defaults"], |
Victor Hsieh | ab293ee | 2021-01-29 17:28:25 -0800 | [diff] [blame] | 64 | test_suites: ["device-tests"], |
Victor Hsieh | 85b4f73 | 2021-03-09 16:02:14 -0800 | [diff] [blame] | 65 | data: [":authfs_test_files"], |
| 66 | } |
| 67 | |
| 68 | filegroup { |
| 69 | name: "authfs_test_files", |
| 70 | srcs: [ |
| 71 | "testdata/cert.der", |
Victor Hsieh | fa4477a | 2021-02-08 10:51:50 -0800 | [diff] [blame] | 72 | "testdata/input.4k", |
Inseob Kim | c0886c2 | 2021-12-13 17:41:24 +0900 | [diff] [blame] | 73 | "testdata/input.4k.fsv_meta", |
Victor Hsieh | fa4477a | 2021-02-08 10:51:50 -0800 | [diff] [blame] | 74 | "testdata/input.4k1", |
Inseob Kim | c0886c2 | 2021-12-13 17:41:24 +0900 | [diff] [blame] | 75 | "testdata/input.4k1.fsv_meta", |
Victor Hsieh | fa4477a | 2021-02-08 10:51:50 -0800 | [diff] [blame] | 76 | "testdata/input.4m", |
Inseob Kim | c0886c2 | 2021-12-13 17:41:24 +0900 | [diff] [blame] | 77 | "testdata/input.4m.fsv_meta", |
| 78 | "testdata/input.4m.fsv_meta.bad_merkle", |
Victor Hsieh | fa4477a | 2021-02-08 10:51:50 -0800 | [diff] [blame] | 79 | ], |
Victor Hsieh | ad46e0b | 2021-01-25 16:07:38 -0800 | [diff] [blame] | 80 | } |
Joel Galenson | a81194e | 2021-08-23 13:45:39 -0700 | [diff] [blame] | 81 | |
| 82 | rust_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 | } |