Bob Badour | 9b84492 | 2022-08-25 09:28:56 -0700 | [diff] [blame] | 1 | package { |
| 2 | // See: http://go/android-license-faq |
| 3 | // A large-scale-change added 'default_applicable_licenses' to import |
| 4 | // all of the 'license_kinds' from "frameworks_native_license" |
| 5 | // to get the below license kinds: |
| 6 | // SPDX-license-identifier-Apache-2.0 |
| 7 | default_applicable_licenses: ["frameworks_native_license"], |
| 8 | } |
| 9 | |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 10 | rust_library { |
| 11 | name: "librpcbinder_rs", |
| 12 | crate_name: "rpcbinder", |
| 13 | srcs: ["src/lib.rs"], |
| 14 | shared_libs: [ |
| 15 | "libutils", |
| 16 | ], |
| 17 | rustlibs: [ |
| 18 | "libbinder_ndk_sys", |
Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 19 | "libbinder_rpc_unstable_bindgen_sys", |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 20 | "libbinder_rs", |
Andrei Homescu | 2617c84 | 2023-08-08 02:52:23 +0000 | [diff] [blame] | 21 | "libcfg_if", |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 22 | "libdowncast_rs", |
David Brazdil | efb5683 | 2022-11-16 11:47:00 +0000 | [diff] [blame] | 23 | "libforeign_types", |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 24 | "liblibc", |
Alice Wang | 893a991 | 2022-10-24 10:44:09 +0000 | [diff] [blame] | 25 | "liblog_rust", |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 26 | ], |
Marcin Radomski | 9fbb1f9 | 2023-01-20 11:38:04 +0000 | [diff] [blame] | 27 | visibility: [ |
| 28 | "//device/google/cuttlefish/shared/minidroid/sample", |
Marcin Radomski | 9fbb1f9 | 2023-01-20 11:38:04 +0000 | [diff] [blame] | 29 | "//packages/modules/Virtualization:__subpackages__", |
| 30 | ], |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 31 | apex_available: [ |
Marcin Radomski | 9fbb1f9 | 2023-01-20 11:38:04 +0000 | [diff] [blame] | 32 | "//apex_available:platform", |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 33 | "com.android.compos", |
Aidan Wolter | 81139db | 2024-08-20 19:19:37 +0000 | [diff] [blame] | 34 | "com.android.microfuchsia", |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 35 | "com.android.uwb", |
| 36 | "com.android.virt", |
| 37 | ], |
| 38 | min_sdk_version: "Tiramisu", |
| 39 | } |
| 40 | |
Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 41 | // Build a separate rust_library rather than depending directly on libbinder_rpc_unstable_bindgen, |
| 42 | // to work around the fact that rust_bindgen targets only produce rlibs and not dylibs, which would |
| 43 | // result in duplicate conflicting versions of libbinder_ndk_sys. This will hopefully be fixed in |
| 44 | // the build system, at which point we can delete this target and go back to using |
| 45 | // libbinder_rpc_unstable_bindgen directly. |
| 46 | rust_library { |
| 47 | name: "libbinder_rpc_unstable_bindgen_sys", |
| 48 | crate_name: "binder_rpc_unstable_bindgen", |
| 49 | srcs: [ |
| 50 | ":libbinder_rpc_unstable_bindgen", |
| 51 | ], |
| 52 | visibility: [":__subpackages__"], |
| 53 | rustlibs: [ |
| 54 | "libbinder_ndk_sys", |
| 55 | ], |
| 56 | shared_libs: [ |
| 57 | "libbinder_rpc_unstable", |
| 58 | "libutils", |
| 59 | ], |
| 60 | apex_available: [ |
Marcin Radomski | 9fbb1f9 | 2023-01-20 11:38:04 +0000 | [diff] [blame] | 61 | "//apex_available:platform", |
Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 62 | "com.android.compos", |
Aidan Wolter | 81139db | 2024-08-20 19:19:37 +0000 | [diff] [blame] | 63 | "com.android.microfuchsia", |
Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 64 | "com.android.uwb", |
| 65 | "com.android.virt", |
| 66 | ], |
| 67 | min_sdk_version: "Tiramisu", |
| 68 | lints: "none", |
| 69 | clippy_lints: "none", |
| 70 | } |
| 71 | |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 72 | // TODO(b/184872979): remove once the RPC Binder API is stabilised. |
| 73 | rust_bindgen { |
| 74 | name: "libbinder_rpc_unstable_bindgen", |
Matthew Maurer | 5fca42a | 2023-12-05 00:47:08 +0000 | [diff] [blame] | 75 | wrapper_src: "BinderBindings.hpp", |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 76 | crate_name: "binder_rpc_unstable_bindgen", |
| 77 | visibility: [":__subpackages__"], |
| 78 | source_stem: "bindings", |
Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 79 | bindgen_flags: [ |
| 80 | "--blocklist-type", |
| 81 | "AIBinder", |
| 82 | "--raw-line", |
| 83 | "use binder_ndk_sys::AIBinder;", |
David Brazdil | ae3ec6a | 2022-12-14 13:13:32 +0000 | [diff] [blame] | 84 | "--rustified-enum", |
| 85 | "ARpcSession_FileDescriptorTransportMode", |
Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 86 | ], |
| 87 | rustlibs: [ |
| 88 | "libbinder_ndk_sys", |
| 89 | ], |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 90 | shared_libs: [ |
| 91 | "libbinder_rpc_unstable", |
| 92 | "libutils", |
| 93 | ], |
| 94 | apex_available: [ |
Marcin Radomski | 9fbb1f9 | 2023-01-20 11:38:04 +0000 | [diff] [blame] | 95 | "//apex_available:platform", |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 96 | "com.android.compos", |
Aidan Wolter | 81139db | 2024-08-20 19:19:37 +0000 | [diff] [blame] | 97 | "com.android.microfuchsia", |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 98 | "com.android.uwb", |
| 99 | "com.android.virt", |
| 100 | ], |
| 101 | min_sdk_version: "Tiramisu", |
| 102 | } |
| 103 | |
| 104 | rust_test { |
| 105 | name: "libbinder_rpc_unstable_bindgen_test", |
| 106 | srcs: [":libbinder_rpc_unstable_bindgen"], |
| 107 | crate_name: "binder_rpc_unstable_bindgen", |
Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 108 | rustlibs: [ |
| 109 | "libbinder_ndk_sys", |
| 110 | ], |
Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 111 | test_suites: ["general-tests"], |
| 112 | auto_gen_config: true, |
| 113 | clippy_lints: "none", |
| 114 | lints: "none", |
| 115 | } |