• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// This file is generated by cargo_embargo.
2// Do not modify this file after the first "rust_*" or "genrule" module
3// because the changes will be overridden on upgrade.
4// Content before the first "rust_*" or "genrule" module is preserved.
5
6package {
7    default_applicable_licenses: ["external_rust_crates_grpcio-sys_license"],
8}
9
10// Added automatically by a large-scale-change that took the approach of
11// 'apply every license found to every target'. While this makes sure we respect
12// every license restriction, it may not be entirely correct.
13//
14// e.g. GPL in an MIT project might only apply to the contrib/ directory.
15//
16// Please consider splitting the single license below into multiple licenses,
17// taking care not to lose any license_kind information, and overriding the
18// default license using the 'licenses: [...]' property on targets as needed.
19//
20// For unused files, consider creating a 'fileGroup' with "//visibility:private"
21// to attach the license to, and including a comment whether the files may be
22// used in the current project.
23// See: http://go/android-license-faq
24license {
25    name: "external_rust_crates_grpcio-sys_license",
26    visibility: [":__subpackages__"],
27    license_kinds: [
28        "SPDX-license-identifier-Apache-2.0",
29        "SPDX-license-identifier-BSD",
30        "SPDX-license-identifier-ISC",
31        "SPDX-license-identifier-MIT",
32        "legacy_unencumbered",
33    ],
34    license_text: [
35        "LICENSE",
36    ],
37}
38
39rust_library {
40    name: "libgrpcio_sys",
41    host_supported: true,
42    crate_name: "grpcio_sys",
43    cargo_env_compat: true,
44    cargo_pkg_version: "0.13.0+1.56.2-patched",
45    crate_root: "src/lib.rs",
46    srcs: [":libgrpc_bindgen"],
47    edition: "2018",
48    features: [
49        "_gen-bindings",
50        "_libz-sys",
51        "_secure",
52        "bindgen",
53        "boringssl",
54        "boringssl-src",
55        "libz-sys",
56    ],
57    rustlibs: [
58        "liblibc",
59        "liblibz_sys",
60    ],
61    apex_available: [
62        "//apex_available:platform",
63        "com.android.btservices",
64    ],
65    product_available: true,
66    vendor_available: true,
67    min_sdk_version: "29",
68    shared_libs: [
69        "libgrpc++",
70        "libgrpc_wrap",
71    ],
72
73}
74
75cc_defaults {
76    name: "libgrpcio_sys_defaults",
77    cflags: [
78        "-DGRPC_SYS_SECURE",
79    ],
80    shared_libs: ["libgrpc++"],
81    apex_available: [
82        "//apex_available:anyapex",
83        "//apex_available:platform",
84        "com.android.btservices",
85    ],
86    product_available: true,
87    vendor_available: true,
88    min_sdk_version: "29",
89}
90
91cc_library {
92    name: "libgrpc_wrap",
93    defaults: ["libgrpcio_sys_defaults"],
94    host_supported: true,
95    srcs: ["grpc_wrap.cc"],
96}
97
98rust_bindgen {
99    name: "libgrpc_bindgen",
100    defaults: ["libgrpcio_sys_defaults"],
101    host_supported: true,
102    wrapper_src: "android/bindgen_wrapper.hpp",
103    source_stem: "grpc-bindings",
104    crate_name: "grpc_bindgen",
105    bindgen_flags: [
106        "--constified-enum-module grpc_status_code",
107        "--default-enum-style rust",
108        "--allowlist-function=\\bgrpc_.*",
109        "--allowlist-function=\\bgpr_.*",
110        "--allowlist-function=\\bgrpcwrap_.*",
111        "--allowlist-var=\\bGRPC_.*",
112        "--allowlist-type=\\bgrpc_.*",
113        "--allowlist-type=\\bgpr_.*",
114        "--allowlist-type=\\bgrpcwrap_.*",
115        "--allowlist-type=\\bcensus_context.*",
116        "--allowlist-type=\\bverify_peer_options.*",
117        "--blocklist-type=(__)?pthread.*",
118        "--blocklist-function=\\bgpr_mu_.*",
119        "--blocklist-function=\\bgpr_cv_.*",
120        "--blocklist-function=\\bgpr_once_.*",
121        "--blocklist-type=gpr_mu",
122        "--blocklist-type=gpr_cv",
123        "--blocklist-type=gpr_once",
124    ],
125    min_sdk_version: "29",
126}
127
128rust_test {
129    name: "libgrpc_bindgen_test",
130    srcs: [":libgrpc_bindgen"],
131    crate_name: "grpc_bindgen_test",
132    test_suites: ["general-tests"],
133    auto_gen_config: true,
134    clippy_lints: "none",
135    lints: "none",
136}
137