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} 48 49rust_library { 50 name: "libstatspull_rust", 51 crate_name: "statspull_rust", 52 srcs: ["stats_pull.rs"], 53 rustlibs: [ 54 "liblazy_static", 55 "liblog_rust", 56 "libstatslog_rust_header", 57 "libstatspull_bindgen", 58 ], 59} 60