blob: 399a8c0b338af100d290cc1df30bbb08921971f3 [file] [log] [blame]
Joel Galenson3afa1392021-09-28 11:07:11 -07001// This file is generated by cargo2android.py --config cargo2android.json.
Joel Galenson23c9e5e2021-04-02 14:59:08 -07002// Do not modify this file as changes will be overridden on upgrade.
Chih-Hung Hsieh98a85252020-10-30 19:17:03 -07003
Bob Badourbb4f7972021-02-12 17:49:20 -08004package {
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
22license {
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 Stoepea7d1ef2020-10-15 21:33:50 +020037rust_library {
38 name: "libgrpcio_sys",
Jeff Vander Stoepea7d1ef2020-10-15 21:33:50 +020039 host_supported: true,
40 crate_name: "grpcio_sys",
Joel Galenson92bc79f2021-08-24 10:11:42 -070041 cargo_env_compat: true,
Jeff Vander Stoepea7d1ef2020-10-15 21:33:50 +020042 srcs: [
43 "src/lib.rs",
44 ":libgrpc_bindgen",
45 ],
46 edition: "2018",
47 features: [
Joel Galenson23c9e5e2021-04-02 14:59:08 -070048 "bindgen",
Joel Galensondacbb992021-09-23 10:55:24 -070049 "boringssl-src",
Jeff Vander Stoepea7d1ef2020-10-15 21:33:50 +020050 "default",
51 "secure",
Joel Galenson23c9e5e2021-04-02 14:59:08 -070052 "use-bindgen",
Jeff Vander Stoepea7d1ef2020-10-15 21:33:50 +020053 ],
54 rustlibs: [
55 "liblibc",
56 "liblibz_sys",
57 ],
58 shared_libs: [
59 "libgrpc++",
60 "libgrpc_wrap"
Roopa Sattiraju4faf6472021-12-21 16:22:39 -080061 ],
62 apex_available: [
63 "//apex_available:platform",
64 "com.android.bluetooth",
65 ],
66 min_sdk_version: "29",
Jeff Vander Stoepea7d1ef2020-10-15 21:33:50 +020067}
68
69cc_defaults {
70 name: "libgrpcio_sys_defaults",
71 cflags: [
Jeff Vander Stoepea7d1ef2020-10-15 21:33:50 +020072 "-DGRPC_SYS_SECURE",
73 ],
Ivan Lozano6a63a032020-10-20 12:15:02 -040074 cpp_std: "c++11",
Jeff Vander Stoepea7d1ef2020-10-15 21:33:50 +020075 shared_libs: ["libgrpc++"],
Roopa Sattiraju4faf6472021-12-21 16:22:39 -080076 apex_available: [
77 "//apex_available:platform",
78 "com.android.bluetooth",
79 ],
80 min_sdk_version: "29",
Jeff Vander Stoepea7d1ef2020-10-15 21:33:50 +020081}
82
83cc_library {
84 name: "libgrpc_wrap",
85 defaults: ["libgrpcio_sys_defaults"],
86 host_supported: true,
87 srcs: ["grpc_wrap.cc"],
88}
89
90rust_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 Galenson92258032021-04-20 09:21:44 -0700101 "--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 Sattirajuead55922022-02-01 22:09:26 -0800117 ],
118 min_sdk_version: "29",
Joel Galenson92bc79f2021-08-24 10:11:42 -0700119}
Joel Galensonc86e0752021-08-24 10:48:53 -0700120
121rust_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}