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// Autogenerate the class (and respective headers) with logging methods and constants 17package { 18 default_applicable_licenses: ["Android-Apache-2.0"], 19} 20 21genrule { 22 name: "statslog_virtualization_header.rs", 23 tools: ["stats-log-api-gen"], 24 cmd: "$(location stats-log-api-gen) --module virtualizationservice --minApiLevel 34 --rustHeader $(genDir)/statslog_virtualization_header.rs --rustHeaderCrate statslog_virtualization_rust_header", 25 out: [ 26 "statslog_virtualization_header.rs", 27 ], 28} 29 30rust_library { 31 name: "libstatslog_virtualization_rust_header", 32 crate_name: "statslog_virtualization_rust_header", 33 srcs: [ 34 "statslog_header_wrapper.rs", 35 ":statslog_virtualization_header.rs", 36 ], 37 rustlibs: [ 38 "libstatspull_bindgen", 39 "libthiserror", 40 ], 41 apex_available: [ 42 "com.android.virt", 43 ], 44 45} 46 47genrule { 48 name: "statslog_virtualization.rs", 49 tools: ["stats-log-api-gen"], 50 cmd: "$(location stats-log-api-gen) --module virtualizationservice --minApiLevel 34 --rustHeaderCrate statslog_virtualization_rust_header --rust $(genDir)/statslog_virtualization.rs", 51 out: [ 52 "statslog_virtualization.rs", 53 ], 54} 55 56rust_library { 57 name: "libstatslog_virtualization_rust", 58 crate_name: "statslog_virtualization_rust", 59 srcs: [ 60 "statslog_wrapper.rs", 61 ":statslog_virtualization.rs", 62 ], 63 rustlibs: [ 64 "libstatslog_virtualization_rust_header", 65 "libstatspull_bindgen", 66 ], 67 apex_available: [ 68 "com.android.virt", 69 ], 70 71} 72