Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 1 | // Copyright 2021, 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 | // See: http://go/android-license-faq |
| 17 | // A large-scale-change added 'default_applicable_licenses' to import |
| 18 | // all of the 'license_kinds' from "system_security_license" |
| 19 | // to get the below license kinds: |
| 20 | // SPDX-license-identifier-Apache-2.0 |
| 21 | default_applicable_licenses: ["system_security_license"], |
| 22 | } |
| 23 | |
| 24 | rust_library { |
| 25 | name: "libdiced_utils", |
| 26 | crate_name: "diced_utils", |
| 27 | srcs: ["src/utils.rs"], |
Janis Danisevskis | aaba4af | 2021-11-18 14:25:07 -0800 | [diff] [blame] | 28 | vendor_available: true, |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 29 | |
| 30 | rustlibs: [ |
| 31 | "android.hardware.security.dice-V1-rust", |
| 32 | "libanyhow", |
Alice Wang | 8722d9e | 2023-02-13 14:56:56 +0000 | [diff] [blame] | 33 | "libdiced_open_dice", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 34 | "libkeystore2_crypto_rust", |
| 35 | ], |
| 36 | } |
| 37 | |
| 38 | rust_test { |
| 39 | name: "diced_utils_test", |
| 40 | crate_name: "diced_utils_test", |
| 41 | srcs: ["src/utils.rs"], |
| 42 | test_suites: ["general-tests"], |
| 43 | auto_gen_config: true, |
| 44 | rustlibs: [ |
| 45 | "android.hardware.security.dice-V1-rust", |
| 46 | "libanyhow", |
Alice Wang | 8722d9e | 2023-02-13 14:56:56 +0000 | [diff] [blame] | 47 | "libdiced_open_dice", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 48 | "libkeystore2_crypto_rust", |
| 49 | ], |
| 50 | } |
| 51 | |
| 52 | rust_library { |
| 53 | name: "libdiced_sample_inputs", |
| 54 | crate_name: "diced_sample_inputs", |
| 55 | srcs: ["src/sample_inputs.rs"], |
Janis Danisevskis | aaba4af | 2021-11-18 14:25:07 -0800 | [diff] [blame] | 56 | vendor_available: true, |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 57 | |
| 58 | rustlibs: [ |
| 59 | "android.hardware.security.dice-V1-rust", |
| 60 | "libanyhow", |
Alice Wang | 4d3059a | 2023-02-15 10:24:33 +0000 | [diff] [blame^] | 61 | "libdiced_open_dice", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 62 | "libdiced_open_dice_cbor", |
| 63 | "libdiced_utils", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 64 | ], |
| 65 | } |
| 66 | |
| 67 | rust_test { |
| 68 | name: "diced_sample_inputs_test", |
| 69 | crate_name: "diced_sample_inputs_test", |
| 70 | srcs: ["src/sample_inputs.rs"], |
| 71 | test_suites: ["general-tests"], |
| 72 | auto_gen_config: true, |
| 73 | rustlibs: [ |
| 74 | "android.hardware.security.dice-V1-rust", |
| 75 | "libanyhow", |
Alice Wang | 4d3059a | 2023-02-15 10:24:33 +0000 | [diff] [blame^] | 76 | "libdiced_open_dice", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 77 | "libdiced_open_dice_cbor", |
| 78 | "libdiced_utils", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 79 | ], |
| 80 | } |
| 81 | |
| 82 | rust_library { |
Janis Danisevskis | aaba4af | 2021-11-18 14:25:07 -0800 | [diff] [blame] | 83 | name: "libdiced_vendor", |
| 84 | crate_name: "diced", |
| 85 | srcs: ["src/lib_vendor.rs"], |
| 86 | |
| 87 | vendor_available: true, |
| 88 | rustlibs: [ |
| 89 | "android.hardware.security.dice-V1-rust", |
Alice Wang | 4d3059a | 2023-02-15 10:24:33 +0000 | [diff] [blame^] | 90 | "libdiced_open_dice", |
Janis Danisevskis | aaba4af | 2021-11-18 14:25:07 -0800 | [diff] [blame] | 91 | "libdiced_open_dice_cbor", |
| 92 | "libanyhow", |
| 93 | "libbinder_rs", |
| 94 | "libdiced_utils", |
| 95 | "libkeystore2_crypto_rust", |
| 96 | "liblibc", |
| 97 | "liblog_rust", |
| 98 | "libnix", |
| 99 | "libserde", |
| 100 | "libserde_cbor", |
| 101 | "libthiserror", |
| 102 | ], |
| 103 | } |
| 104 | |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 105 | rust_test { |
Janis Danisevskis | aaba4af | 2021-11-18 14:25:07 -0800 | [diff] [blame] | 106 | name: "diced_vendor_test", |
| 107 | crate_name: "diced_vendor_test", |
| 108 | srcs: ["src/lib_vendor.rs"], |
| 109 | test_suites: ["general-tests"], |
| 110 | auto_gen_config: true, |
| 111 | rustlibs: [ |
| 112 | "android.hardware.security.dice-V1-rust", |
| 113 | "libanyhow", |
Alice Wang | 4d3059a | 2023-02-15 10:24:33 +0000 | [diff] [blame^] | 114 | "libdiced_open_dice", |
Janis Danisevskis | aaba4af | 2021-11-18 14:25:07 -0800 | [diff] [blame] | 115 | "libdiced_open_dice_cbor", |
| 116 | "libdiced_sample_inputs", |
| 117 | "libdiced_utils", |
| 118 | "libbinder_rs", |
| 119 | "libkeystore2_crypto_rust", |
| 120 | "liblibc", |
| 121 | "liblog_rust", |
| 122 | "libnix", |
| 123 | "libserde", |
| 124 | "libserde_cbor", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 125 | "libthiserror", |
| 126 | ], |
| 127 | } |
Janis Danisevskis | da092a1 | 2021-11-17 22:58:16 -0800 | [diff] [blame] | 128 | |
| 129 | rust_test { |
| 130 | name: "diced_client_test", |
| 131 | srcs: [ |
| 132 | "src/diced_client_test.rs", |
| 133 | ], |
| 134 | require_root: true, |
| 135 | auto_gen_config: true, |
| 136 | test_suites: [ |
| 137 | "general-tests", |
| 138 | ], |
| 139 | |
| 140 | rustlibs: [ |
| 141 | "android.hardware.security.dice-V1-rust", |
| 142 | "android.security.dice-rust", |
| 143 | "libanyhow", |
| 144 | "libbinder_rs", |
Alice Wang | 4d3059a | 2023-02-15 10:24:33 +0000 | [diff] [blame^] | 145 | "libdiced_open_dice", |
Janis Danisevskis | da092a1 | 2021-11-17 22:58:16 -0800 | [diff] [blame] | 146 | "libdiced_open_dice_cbor", |
| 147 | "libdiced_sample_inputs", |
| 148 | "libdiced_utils", |
| 149 | "libnix", |
| 150 | ], |
| 151 | } |