Treehugger Robot | 3ffa832 | 2021-11-22 12:06:47 +0000 | [diff] [blame] | 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 |
Bob Badour | 981bacb | 2022-01-20 10:37:18 -0800 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 19 | } |
| 20 | |
Treehugger Robot | 3ffa832 | 2021-11-22 12:06:47 +0000 | [diff] [blame] | 21 | genrule { |
| 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 Stokes | 6472ccd | 2022-08-31 13:41:28 +0100 | [diff] [blame] | 30 | rust_defaults { |
| 31 | name: "libstatslog_virtualization_rust_defaults", |
Nikita Ioffe | da1b273 | 2023-09-04 13:46:56 +0100 | [diff] [blame^] | 32 | defaults: ["avf_build_flags_rust"], |
Alan Stokes | 6472ccd | 2022-08-31 13:41:28 +0100 | [diff] [blame] | 33 | edition: "2021", |
| 34 | rustlibs: [ |
| 35 | "libstatspull_bindgen", |
| 36 | ], |
| 37 | apex_available: [ |
| 38 | "com.android.virt", |
| 39 | ], |
| 40 | } |
| 41 | |
Treehugger Robot | 3ffa832 | 2021-11-22 12:06:47 +0000 | [diff] [blame] | 42 | rust_library { |
| 43 | name: "libstatslog_virtualization_rust_header", |
Alan Stokes | 6472ccd | 2022-08-31 13:41:28 +0100 | [diff] [blame] | 44 | defaults: ["libstatslog_virtualization_rust_defaults"], |
Treehugger Robot | 3ffa832 | 2021-11-22 12:06:47 +0000 | [diff] [blame] | 45 | crate_name: "statslog_virtualization_rust_header", |
| 46 | srcs: [ |
| 47 | "statslog_header_wrapper.rs", |
| 48 | ":statslog_virtualization_header.rs", |
| 49 | ], |
| 50 | rustlibs: [ |
Treehugger Robot | 3ffa832 | 2021-11-22 12:06:47 +0000 | [diff] [blame] | 51 | "libthiserror", |
| 52 | ], |
Treehugger Robot | 3ffa832 | 2021-11-22 12:06:47 +0000 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | genrule { |
| 56 | name: "statslog_virtualization.rs", |
| 57 | tools: ["stats-log-api-gen"], |
| 58 | cmd: "$(location stats-log-api-gen) --module virtualizationservice --minApiLevel 34 --rustHeaderCrate statslog_virtualization_rust_header --rust $(genDir)/statslog_virtualization.rs", |
| 59 | out: [ |
| 60 | "statslog_virtualization.rs", |
| 61 | ], |
| 62 | } |
| 63 | |
| 64 | rust_library { |
| 65 | name: "libstatslog_virtualization_rust", |
Alan Stokes | 6472ccd | 2022-08-31 13:41:28 +0100 | [diff] [blame] | 66 | defaults: ["libstatslog_virtualization_rust_defaults"], |
Treehugger Robot | 3ffa832 | 2021-11-22 12:06:47 +0000 | [diff] [blame] | 67 | crate_name: "statslog_virtualization_rust", |
| 68 | srcs: [ |
| 69 | "statslog_wrapper.rs", |
| 70 | ":statslog_virtualization.rs", |
| 71 | ], |
| 72 | rustlibs: [ |
| 73 | "libstatslog_virtualization_rust_header", |
Treehugger Robot | 3ffa832 | 2021-11-22 12:06:47 +0000 | [diff] [blame] | 74 | ], |
Treehugger Robot | 3ffa832 | 2021-11-22 12:06:47 +0000 | [diff] [blame] | 75 | } |