blob: a702ea17d4efd88ab1e53783e50fb5453c2cb189 [file] [log] [blame]
Treehugger Robot3ffa8322021-11-22 12:06:47 +00001//
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
Bob Badour981bacb2022-01-20 10:37:18 -080017package {
18 default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
Treehugger Robot3ffa8322021-11-22 12:06:47 +000021genrule {
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
Alan Stokes6472ccd2022-08-31 13:41:28 +010030rust_defaults {
31 name: "libstatslog_virtualization_rust_defaults",
32 edition: "2021",
33 rustlibs: [
34 "libstatspull_bindgen",
35 ],
36 apex_available: [
37 "com.android.virt",
38 ],
39}
40
Treehugger Robot3ffa8322021-11-22 12:06:47 +000041rust_library {
42 name: "libstatslog_virtualization_rust_header",
Alan Stokes6472ccd2022-08-31 13:41:28 +010043 defaults: ["libstatslog_virtualization_rust_defaults"],
Treehugger Robot3ffa8322021-11-22 12:06:47 +000044 crate_name: "statslog_virtualization_rust_header",
45 srcs: [
46 "statslog_header_wrapper.rs",
47 ":statslog_virtualization_header.rs",
48 ],
49 rustlibs: [
Treehugger Robot3ffa8322021-11-22 12:06:47 +000050 "libthiserror",
51 ],
Treehugger Robot3ffa8322021-11-22 12:06:47 +000052}
53
54genrule {
55 name: "statslog_virtualization.rs",
56 tools: ["stats-log-api-gen"],
57 cmd: "$(location stats-log-api-gen) --module virtualizationservice --minApiLevel 34 --rustHeaderCrate statslog_virtualization_rust_header --rust $(genDir)/statslog_virtualization.rs",
58 out: [
59 "statslog_virtualization.rs",
60 ],
61}
62
63rust_library {
64 name: "libstatslog_virtualization_rust",
Alan Stokes6472ccd2022-08-31 13:41:28 +010065 defaults: ["libstatslog_virtualization_rust_defaults"],
Treehugger Robot3ffa8322021-11-22 12:06:47 +000066 crate_name: "statslog_virtualization_rust",
67 srcs: [
68 "statslog_wrapper.rs",
69 ":statslog_virtualization.rs",
70 ],
71 rustlibs: [
72 "libstatslog_virtualization_rust_header",
Treehugger Robot3ffa8322021-11-22 12:06:47 +000073 ],
Treehugger Robot3ffa8322021-11-22 12:06:47 +000074}