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