| 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", | 
|  | 21 | "libdowncast_rs", | 
|  | 22 | "liblibc", | 
| Alice Wang | 893a991 | 2022-10-24 10:44:09 +0000 | [diff] [blame] | 23 | "liblog_rust", | 
| Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 24 | ], | 
|  | 25 | apex_available: [ | 
|  | 26 | "com.android.compos", | 
|  | 27 | "com.android.uwb", | 
|  | 28 | "com.android.virt", | 
|  | 29 | ], | 
|  | 30 | min_sdk_version: "Tiramisu", | 
|  | 31 | } | 
|  | 32 |  | 
| Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 33 | // Build a separate rust_library rather than depending directly on libbinder_rpc_unstable_bindgen, | 
|  | 34 | // to work around the fact that rust_bindgen targets only produce rlibs and not dylibs, which would | 
|  | 35 | // result in duplicate conflicting versions of libbinder_ndk_sys. This will hopefully be fixed in | 
|  | 36 | // the build system, at which point we can delete this target and go back to using | 
|  | 37 | // libbinder_rpc_unstable_bindgen directly. | 
|  | 38 | rust_library { | 
|  | 39 | name: "libbinder_rpc_unstable_bindgen_sys", | 
|  | 40 | crate_name: "binder_rpc_unstable_bindgen", | 
|  | 41 | srcs: [ | 
|  | 42 | ":libbinder_rpc_unstable_bindgen", | 
|  | 43 | ], | 
|  | 44 | visibility: [":__subpackages__"], | 
|  | 45 | rustlibs: [ | 
|  | 46 | "libbinder_ndk_sys", | 
|  | 47 | ], | 
|  | 48 | shared_libs: [ | 
|  | 49 | "libbinder_rpc_unstable", | 
|  | 50 | "libutils", | 
|  | 51 | ], | 
|  | 52 | apex_available: [ | 
|  | 53 | "com.android.compos", | 
|  | 54 | "com.android.uwb", | 
|  | 55 | "com.android.virt", | 
|  | 56 | ], | 
|  | 57 | min_sdk_version: "Tiramisu", | 
|  | 58 | lints: "none", | 
|  | 59 | clippy_lints: "none", | 
|  | 60 | } | 
|  | 61 |  | 
| Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 62 | // TODO(b/184872979): remove once the RPC Binder API is stabilised. | 
|  | 63 | rust_bindgen { | 
|  | 64 | name: "libbinder_rpc_unstable_bindgen", | 
|  | 65 | wrapper_src: ":libbinder_rpc_unstable_header", | 
|  | 66 | crate_name: "binder_rpc_unstable_bindgen", | 
|  | 67 | visibility: [":__subpackages__"], | 
|  | 68 | source_stem: "bindings", | 
| Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 69 | bindgen_flags: [ | 
|  | 70 | "--blocklist-type", | 
|  | 71 | "AIBinder", | 
|  | 72 | "--raw-line", | 
|  | 73 | "use binder_ndk_sys::AIBinder;", | 
|  | 74 | ], | 
|  | 75 | rustlibs: [ | 
|  | 76 | "libbinder_ndk_sys", | 
|  | 77 | ], | 
| Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 78 | shared_libs: [ | 
|  | 79 | "libbinder_rpc_unstable", | 
|  | 80 | "libutils", | 
|  | 81 | ], | 
|  | 82 | apex_available: [ | 
|  | 83 | "com.android.compos", | 
|  | 84 | "com.android.uwb", | 
|  | 85 | "com.android.virt", | 
|  | 86 | ], | 
|  | 87 | min_sdk_version: "Tiramisu", | 
|  | 88 | } | 
|  | 89 |  | 
|  | 90 | rust_test { | 
|  | 91 | name: "libbinder_rpc_unstable_bindgen_test", | 
|  | 92 | srcs: [":libbinder_rpc_unstable_bindgen"], | 
|  | 93 | crate_name: "binder_rpc_unstable_bindgen", | 
| Andrew Walbran | 34e7bdf | 2022-08-24 11:16:24 +0000 | [diff] [blame] | 94 | rustlibs: [ | 
|  | 95 | "libbinder_ndk_sys", | 
|  | 96 | ], | 
| Andrew Walbran | c4d1cbd | 2022-08-02 17:15:56 +0000 | [diff] [blame] | 97 | test_suites: ["general-tests"], | 
|  | 98 | auto_gen_config: true, | 
|  | 99 | clippy_lints: "none", | 
|  | 100 | lints: "none", | 
|  | 101 | } |