Joel Galenson | 3afa139 | 2021-09-28 11:07:11 -0700 | [diff] [blame] | 1 | // This file is generated by cargo2android.py --config cargo2android.json. |
Joel Galenson | 23c9e5e | 2021-04-02 14:59:08 -0700 | [diff] [blame] | 2 | // Do not modify this file as changes will be overridden on upgrade. |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 3 | |
Bob Badour | bb4f797 | 2021-02-12 17:49:20 -0800 | [diff] [blame] | 4 | package { |
| 5 | default_applicable_licenses: ["external_rust_crates_grpcio-sys_license"], |
| 6 | } |
| 7 | |
| 8 | // Added automatically by a large-scale-change that took the approach of |
| 9 | // 'apply every license found to every target'. While this makes sure we respect |
| 10 | // every license restriction, it may not be entirely correct. |
| 11 | // |
| 12 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 13 | // |
| 14 | // Please consider splitting the single license below into multiple licenses, |
| 15 | // taking care not to lose any license_kind information, and overriding the |
| 16 | // default license using the 'licenses: [...]' property on targets as needed. |
| 17 | // |
| 18 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 19 | // to attach the license to, and including a comment whether the files may be |
| 20 | // used in the current project. |
| 21 | // See: http://go/android-license-faq |
| 22 | license { |
| 23 | name: "external_rust_crates_grpcio-sys_license", |
| 24 | visibility: [":__subpackages__"], |
| 25 | license_kinds: [ |
| 26 | "SPDX-license-identifier-Apache-2.0", |
| 27 | "SPDX-license-identifier-BSD", |
| 28 | "SPDX-license-identifier-ISC", |
| 29 | "SPDX-license-identifier-MIT", |
| 30 | "legacy_unencumbered", |
| 31 | ], |
| 32 | license_text: [ |
| 33 | "LICENSE", |
| 34 | ], |
| 35 | } |
| 36 | |
Jeff Vander Stoep | ea7d1ef | 2020-10-15 21:33:50 +0200 | [diff] [blame] | 37 | rust_library { |
| 38 | name: "libgrpcio_sys", |
Jeff Vander Stoep | ea7d1ef | 2020-10-15 21:33:50 +0200 | [diff] [blame] | 39 | host_supported: true, |
| 40 | crate_name: "grpcio_sys", |
Joel Galenson | 92bc79f | 2021-08-24 10:11:42 -0700 | [diff] [blame] | 41 | cargo_env_compat: true, |
Jeff Vander Stoep | ea7d1ef | 2020-10-15 21:33:50 +0200 | [diff] [blame] | 42 | srcs: [ |
| 43 | "src/lib.rs", |
| 44 | ":libgrpc_bindgen", |
| 45 | ], |
| 46 | edition: "2018", |
| 47 | features: [ |
Joel Galenson | 23c9e5e | 2021-04-02 14:59:08 -0700 | [diff] [blame] | 48 | "bindgen", |
Joel Galenson | dacbb99 | 2021-09-23 10:55:24 -0700 | [diff] [blame] | 49 | "boringssl-src", |
Jeff Vander Stoep | ea7d1ef | 2020-10-15 21:33:50 +0200 | [diff] [blame] | 50 | "default", |
| 51 | "secure", |
Joel Galenson | 23c9e5e | 2021-04-02 14:59:08 -0700 | [diff] [blame] | 52 | "use-bindgen", |
Jeff Vander Stoep | ea7d1ef | 2020-10-15 21:33:50 +0200 | [diff] [blame] | 53 | ], |
| 54 | rustlibs: [ |
| 55 | "liblibc", |
| 56 | "liblibz_sys", |
| 57 | ], |
| 58 | shared_libs: [ |
| 59 | "libgrpc++", |
| 60 | "libgrpc_wrap" |
Roopa Sattiraju | 4faf647 | 2021-12-21 16:22:39 -0800 | [diff] [blame] | 61 | ], |
| 62 | apex_available: [ |
| 63 | "//apex_available:platform", |
| 64 | "com.android.bluetooth", |
| 65 | ], |
| 66 | min_sdk_version: "29", |
Jeff Vander Stoep | ea7d1ef | 2020-10-15 21:33:50 +0200 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | cc_defaults { |
| 70 | name: "libgrpcio_sys_defaults", |
| 71 | cflags: [ |
Jeff Vander Stoep | ea7d1ef | 2020-10-15 21:33:50 +0200 | [diff] [blame] | 72 | "-DGRPC_SYS_SECURE", |
| 73 | ], |
Ivan Lozano | 6a63a03 | 2020-10-20 12:15:02 -0400 | [diff] [blame] | 74 | cpp_std: "c++11", |
Jeff Vander Stoep | ea7d1ef | 2020-10-15 21:33:50 +0200 | [diff] [blame] | 75 | shared_libs: ["libgrpc++"], |
Roopa Sattiraju | 4faf647 | 2021-12-21 16:22:39 -0800 | [diff] [blame] | 76 | apex_available: [ |
| 77 | "//apex_available:platform", |
| 78 | "com.android.bluetooth", |
| 79 | ], |
| 80 | min_sdk_version: "29", |
Jeff Vander Stoep | ea7d1ef | 2020-10-15 21:33:50 +0200 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | cc_library { |
| 84 | name: "libgrpc_wrap", |
| 85 | defaults: ["libgrpcio_sys_defaults"], |
| 86 | host_supported: true, |
| 87 | srcs: ["grpc_wrap.cc"], |
| 88 | } |
| 89 | |
| 90 | rust_bindgen { |
| 91 | name: "libgrpc_bindgen", |
| 92 | defaults: ["libgrpcio_sys_defaults"], |
| 93 | host_supported: true, |
| 94 | wrapper_src: "android/bindgen_wrapper.hpp", |
| 95 | source_stem: "grpc-bindings", |
| 96 | crate_name: "grpc_bindgen", |
| 97 | bindgen_flags: [ |
| 98 | "--size_t-is-usize", |
| 99 | "--constified-enum-module grpc_status_code", |
| 100 | "--default-enum-style rust", |
Joel Galenson | 9225803 | 2021-04-20 09:21:44 -0700 | [diff] [blame] | 101 | "--allowlist-function=\\bgrpc_.*", |
| 102 | "--allowlist-function=\\bgpr_.*", |
| 103 | "--allowlist-function=\\bgrpcwrap_.*", |
| 104 | "--allowlist-var=\\bGRPC_.*", |
| 105 | "--allowlist-type=\\bgrpc_.*", |
| 106 | "--allowlist-type=\\bgpr_.*", |
| 107 | "--allowlist-type=\\bgrpcwrap_.*", |
| 108 | "--allowlist-type=\\bcensus_context.*", |
| 109 | "--allowlist-type=\\bverify_peer_options.*", |
| 110 | "--blocklist-type=(__)?pthread.*", |
| 111 | "--blocklist-function=\\bgpr_mu_.*", |
| 112 | "--blocklist-function=\\bgpr_cv_.*", |
| 113 | "--blocklist-function=\\bgpr_once_.*", |
| 114 | "--blocklist-type=gpr_mu", |
| 115 | "--blocklist-type=gpr_cv", |
| 116 | "--blocklist-type=gpr_once", |
Roopa Sattiraju | ead5592 | 2022-02-01 22:09:26 -0800 | [diff] [blame] | 117 | ], |
| 118 | min_sdk_version: "29", |
Joel Galenson | 92bc79f | 2021-08-24 10:11:42 -0700 | [diff] [blame] | 119 | } |
Joel Galenson | c86e075 | 2021-08-24 10:48:53 -0700 | [diff] [blame] | 120 | |
| 121 | rust_test { |
| 122 | name: "libgrpc_bindgen_test", |
| 123 | srcs: [":libgrpc_bindgen"], |
| 124 | crate_name: "grpc_bindgen_test", |
| 125 | test_suites: ["general-tests"], |
| 126 | auto_gen_config: true, |
| 127 | clippy_lints: "none", |
| 128 | lints: "none", |
| 129 | } |