• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2021 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21rust_bindgen {
22    name: "libstatspull_bindgen",
23    wrapper_src: "statslog.h",
24    crate_name: "statspull_bindgen",
25    source_stem: "bindings",
26    bindgen_flags: [
27        "--size_t-is-usize",
28        "--allowlist-function=AStatsEventList_addStatsEvent",
29        "--allowlist-function=AStatsEvent_.*",
30        "--allowlist-function=AStatsManager_.*",
31        "--allowlist-var=AStatsManager_.*",
32    ],
33    target: {
34        android: {
35            shared_libs: [
36                "libstatspull",
37                "libstatssocket",
38            ],
39        },
40        host: {
41            static_libs: [
42                "libstatspull",
43                "libstatssocket",
44            ],
45        },
46    },
47    min_sdk_version: "apex_inherit",
48    apex_available: [
49        "//apex_available:platform",
50        "com.android.virt",
51    ]
52}
53
54rust_library {
55    name: "libstatspull_rust",
56    crate_name: "statspull_rust",
57    srcs: ["stats_pull.rs"],
58    rustlibs: [
59        "liblazy_static",
60        "liblog_rust",
61        "libstatslog_rust_header",
62        "libstatspull_bindgen",
63    ],
64}
65
66rust_test {
67    name: "libstatspull_bindgen_test",
68    srcs: [":libstatspull_bindgen"],
69    crate_name: "statspull_bindgen_test",
70    test_suites: ["general-tests"],
71    auto_gen_config: true,
72    clippy_lints: "none",
73    lints: "none",
74}
75