David Drysdale | a1ec5f9 | 2022-08-30 18:53:32 +0100 | [diff] [blame] | 1 | // Copyright 2022, The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package { |
| 16 | default_applicable_licenses: ["system_keymint_license"], |
| 17 | } |
| 18 | |
| 19 | rust_defaults { |
| 20 | name: "kmr_hal_defaults", |
| 21 | edition: "2021", |
David Drysdale | 63e6ad6 | 2023-05-05 17:41:08 +0100 | [diff] [blame] | 22 | lints: "android", |
David Drysdale | a1ec5f9 | 2022-08-30 18:53:32 +0100 | [diff] [blame] | 23 | rustlibs: [ |
Seth Moore | ea8d99b | 2022-11-04 17:39:05 +0000 | [diff] [blame] | 24 | "android.hardware.security.rkp-V3-rust", |
David Drysdale | a1ec5f9 | 2022-08-30 18:53:32 +0100 | [diff] [blame] | 25 | "android.hardware.security.secureclock-V1-rust", |
| 26 | "android.hardware.security.sharedsecret-V1-rust", |
| 27 | "libbinder_rs", |
| 28 | "libciborium", |
| 29 | "libciborium_io", |
David Drysdale | 6512c70 | 2022-11-01 11:32:14 +0000 | [diff] [blame] | 30 | "libhex", |
David Drysdale | a1ec5f9 | 2022-08-30 18:53:32 +0100 | [diff] [blame] | 31 | "liblog_rust", |
| 32 | "libregex", |
| 33 | "librustutils", |
| 34 | ], |
| 35 | proc_macros: [ |
| 36 | "libkmr_derive", |
| 37 | ], |
| 38 | } |
| 39 | |
| 40 | rust_library { |
| 41 | name: "libkmr_hal", |
| 42 | crate_name: "kmr_hal", |
| 43 | srcs: ["src/lib.rs"], |
| 44 | vendor_available: true, |
David Drysdale | 1aa5637 | 2023-10-06 10:21:30 +0100 | [diff] [blame] | 45 | // Default target includes support for all versions of the KeyMint HAL. |
| 46 | features: [ |
| 47 | "hal_v2", |
| 48 | "hal_v3", |
| 49 | ], |
| 50 | defaults: [ |
| 51 | "keymint_use_latest_hal_aidl_rust", |
| 52 | "kmr_hal_defaults", |
| 53 | ], |
| 54 | rustlibs: [ |
| 55 | "libkmr_wire", |
| 56 | ], |
| 57 | } |
| 58 | |
| 59 | rust_library { |
| 60 | name: "libkmr_hal_v2", |
| 61 | crate_name: "kmr_hal", |
| 62 | srcs: ["src/lib.rs"], |
| 63 | vendor_available: true, |
| 64 | features: [ |
| 65 | "hal_v2", |
| 66 | ], |
David Drysdale | a1ec5f9 | 2022-08-30 18:53:32 +0100 | [diff] [blame] | 67 | defaults: [ |
| 68 | "kmr_hal_defaults", |
| 69 | ], |
David Drysdale | 1aa5637 | 2023-10-06 10:21:30 +0100 | [diff] [blame] | 70 | rustlibs: [ |
| 71 | "android.hardware.security.keymint-V2-rust", |
| 72 | "libkmr_wire_hal_v2", |
| 73 | ], |
| 74 | } |
| 75 | |
| 76 | rust_library { |
| 77 | name: "libkmr_hal_v1", |
| 78 | crate_name: "kmr_hal", |
| 79 | srcs: ["src/lib.rs"], |
| 80 | vendor_available: true, |
| 81 | defaults: [ |
| 82 | "kmr_hal_defaults", |
| 83 | ], |
| 84 | rustlibs: [ |
| 85 | "android.hardware.security.keymint-V1-rust", |
| 86 | "libkmr_wire_hal_v1", |
| 87 | ], |
David Drysdale | a1ec5f9 | 2022-08-30 18:53:32 +0100 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | rust_test { |
| 91 | name: "libkmr_hal_test", |
| 92 | crate_name: "libkeymint_rust_test", |
| 93 | srcs: ["src/lib.rs"], |
David Drysdale | 1aa5637 | 2023-10-06 10:21:30 +0100 | [diff] [blame] | 94 | features: [ |
| 95 | "hal_v2", |
| 96 | "hal_v3", |
| 97 | ], |
David Drysdale | a1ec5f9 | 2022-08-30 18:53:32 +0100 | [diff] [blame] | 98 | defaults: [ |
David Drysdale | 1aa5637 | 2023-10-06 10:21:30 +0100 | [diff] [blame] | 99 | "keymint_use_latest_hal_aidl_rust", |
David Drysdale | a1ec5f9 | 2022-08-30 18:53:32 +0100 | [diff] [blame] | 100 | "kmr_hal_defaults", |
| 101 | ], |
David Drysdale | 1aa5637 | 2023-10-06 10:21:30 +0100 | [diff] [blame] | 102 | rustlibs: [ |
| 103 | "libkmr_wire", |
| 104 | ], |
David Drysdale | a1ec5f9 | 2022-08-30 18:53:32 +0100 | [diff] [blame] | 105 | test_suites: ["general-tests"], |
| 106 | } |