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", |
| 33 | "libdiced_open_dice_cbor", |
| 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", |
| 47 | "libdiced_open_dice_cbor", |
| 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", |
| 61 | "libdiced_open_dice_cbor", |
| 62 | "libdiced_utils", |
| 63 | "libkeystore2_crypto_rust", |
| 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", |
| 76 | "libdiced_open_dice_cbor", |
| 77 | "libdiced_utils", |
| 78 | "libkeystore2_crypto_rust", |
| 79 | ], |
| 80 | } |
| 81 | |
| 82 | rust_library { |
| 83 | name: "libdiced", |
| 84 | crate_name: "diced", |
| 85 | srcs: ["src/lib.rs"], |
| 86 | |
| 87 | rustlibs: [ |
| 88 | "android.hardware.security.dice-V1-rust", |
| 89 | "android.security.dice-rust", |
| 90 | "libdiced_open_dice_cbor", |
| 91 | "libanyhow", |
| 92 | "libbinder_rs", |
| 93 | "libdiced_utils", |
| 94 | "libkeystore2_crypto_rust", |
| 95 | "libkeystore2_selinux", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 96 | "liblibc", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 97 | "liblog_rust", |
| 98 | "libthiserror", |
| 99 | ], |
| 100 | } |
| 101 | |
Janis Danisevskis | aaba4af | 2021-11-18 14:25:07 -0800 | [diff] [blame] | 102 | rust_library { |
| 103 | name: "libdiced_vendor", |
| 104 | crate_name: "diced", |
| 105 | srcs: ["src/lib_vendor.rs"], |
| 106 | |
| 107 | vendor_available: true, |
| 108 | rustlibs: [ |
| 109 | "android.hardware.security.dice-V1-rust", |
| 110 | "libdiced_open_dice_cbor", |
| 111 | "libanyhow", |
| 112 | "libbinder_rs", |
| 113 | "libdiced_utils", |
| 114 | "libkeystore2_crypto_rust", |
| 115 | "liblibc", |
| 116 | "liblog_rust", |
| 117 | "libnix", |
| 118 | "libserde", |
| 119 | "libserde_cbor", |
| 120 | "libthiserror", |
| 121 | ], |
| 122 | } |
| 123 | |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 124 | rust_binary { |
| 125 | name: "diced", |
| 126 | srcs: ["src/diced_main.rs"], |
Jiyong Park | e726574 | 2022-01-14 01:02:31 +0900 | [diff] [blame^] | 127 | prefer_rlib: true, |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 128 | rustlibs: [ |
Janis Danisevskis | 41e6719 | 2021-11-05 09:00:19 -0700 | [diff] [blame] | 129 | "android.hardware.security.dice-V1-rust", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 130 | "libandroid_logger", |
| 131 | "libbinder_rs", |
| 132 | "libdiced", |
| 133 | "libdiced_open_dice_cbor", |
Janis Danisevskis | 99652dc | 2021-10-20 15:59:33 -0700 | [diff] [blame] | 134 | "libdiced_sample_inputs", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 135 | "libdiced_utils", |
| 136 | "liblog_rust", |
| 137 | ], |
| 138 | init_rc: ["diced.rc"], |
| 139 | } |
| 140 | |
| 141 | rust_test { |
| 142 | name: "diced_test", |
| 143 | crate_name: "diced_test", |
| 144 | srcs: ["src/lib.rs"], |
| 145 | test_suites: ["general-tests"], |
| 146 | auto_gen_config: true, |
| 147 | rustlibs: [ |
| 148 | "android.hardware.security.dice-V1-rust", |
| 149 | "android.security.dice-rust", |
| 150 | "libanyhow", |
| 151 | "libbinder_rs", |
| 152 | "libdiced_open_dice_cbor", |
| 153 | "libdiced_utils", |
| 154 | "libkeystore2_crypto_rust", |
| 155 | "libkeystore2_selinux", |
| 156 | "libkeystore2_vintf_rust", |
| 157 | "liblibc", |
| 158 | "liblog_rust", |
Janis Danisevskis | aaba4af | 2021-11-18 14:25:07 -0800 | [diff] [blame] | 159 | "libnix", |
| 160 | "libserde", |
| 161 | "libserde_cbor", |
| 162 | "libthiserror", |
| 163 | ], |
| 164 | } |
| 165 | |
| 166 | rust_test { |
| 167 | name: "diced_vendor_test", |
| 168 | crate_name: "diced_vendor_test", |
| 169 | srcs: ["src/lib_vendor.rs"], |
| 170 | test_suites: ["general-tests"], |
| 171 | auto_gen_config: true, |
| 172 | rustlibs: [ |
| 173 | "android.hardware.security.dice-V1-rust", |
| 174 | "libanyhow", |
| 175 | "libdiced_open_dice_cbor", |
| 176 | "libdiced_sample_inputs", |
| 177 | "libdiced_utils", |
| 178 | "libbinder_rs", |
| 179 | "libkeystore2_crypto_rust", |
| 180 | "liblibc", |
| 181 | "liblog_rust", |
| 182 | "libnix", |
| 183 | "libserde", |
| 184 | "libserde_cbor", |
Janis Danisevskis | c51dff8 | 2021-10-20 09:51:16 -0700 | [diff] [blame] | 185 | "libthiserror", |
| 186 | ], |
| 187 | } |
Janis Danisevskis | da092a1 | 2021-11-17 22:58:16 -0800 | [diff] [blame] | 188 | |
| 189 | rust_test { |
| 190 | name: "diced_client_test", |
| 191 | srcs: [ |
| 192 | "src/diced_client_test.rs", |
| 193 | ], |
| 194 | require_root: true, |
| 195 | auto_gen_config: true, |
| 196 | test_suites: [ |
| 197 | "general-tests", |
| 198 | ], |
| 199 | |
| 200 | rustlibs: [ |
| 201 | "android.hardware.security.dice-V1-rust", |
| 202 | "android.security.dice-rust", |
| 203 | "libanyhow", |
| 204 | "libbinder_rs", |
| 205 | "libdiced_open_dice_cbor", |
| 206 | "libdiced_sample_inputs", |
| 207 | "libdiced_utils", |
| 208 | "libnix", |
| 209 | ], |
| 210 | } |