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