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"], |
| 28 | |
| 29 | rustlibs: [ |
| 30 | "android.hardware.security.dice-V1-rust", |
| 31 | "libanyhow", |
| 32 | "libdiced_open_dice_cbor", |
| 33 | "libkeystore2_crypto_rust", |
| 34 | ], |
| 35 | } |
| 36 | |
| 37 | rust_test { |
| 38 | name: "diced_utils_test", |
| 39 | crate_name: "diced_utils_test", |
| 40 | srcs: ["src/utils.rs"], |
| 41 | test_suites: ["general-tests"], |
| 42 | auto_gen_config: true, |
| 43 | rustlibs: [ |
| 44 | "android.hardware.security.dice-V1-rust", |
| 45 | "libanyhow", |
| 46 | "libdiced_open_dice_cbor", |
| 47 | "libkeystore2_crypto_rust", |
| 48 | ], |
| 49 | } |
| 50 | |
| 51 | rust_library { |
| 52 | name: "libdiced_sample_inputs", |
| 53 | crate_name: "diced_sample_inputs", |
| 54 | srcs: ["src/sample_inputs.rs"], |
| 55 | |
| 56 | rustlibs: [ |
| 57 | "android.hardware.security.dice-V1-rust", |
| 58 | "libanyhow", |
| 59 | "libdiced_open_dice_cbor", |
| 60 | "libdiced_utils", |
| 61 | "libkeystore2_crypto_rust", |
| 62 | ], |
| 63 | } |
| 64 | |
| 65 | rust_test { |
| 66 | name: "diced_sample_inputs_test", |
| 67 | crate_name: "diced_sample_inputs_test", |
| 68 | srcs: ["src/sample_inputs.rs"], |
| 69 | test_suites: ["general-tests"], |
| 70 | auto_gen_config: true, |
| 71 | rustlibs: [ |
| 72 | "android.hardware.security.dice-V1-rust", |
| 73 | "libanyhow", |
| 74 | "libdiced_open_dice_cbor", |
| 75 | "libdiced_utils", |
| 76 | "libkeystore2_crypto_rust", |
| 77 | ], |
| 78 | } |
| 79 | |
| 80 | rust_library { |
| 81 | name: "libdiced", |
| 82 | crate_name: "diced", |
| 83 | srcs: ["src/lib.rs"], |
| 84 | |
| 85 | rustlibs: [ |
| 86 | "android.hardware.security.dice-V1-rust", |
| 87 | "android.security.dice-rust", |
| 88 | "libdiced_open_dice_cbor", |
| 89 | "libanyhow", |
| 90 | "libbinder_rs", |
| 91 | "libdiced_utils", |
| 92 | "libkeystore2_crypto_rust", |
| 93 | "libkeystore2_selinux", |
| 94 | "libkeystore2_vintf_rust", |
| 95 | "liblibc", |
| 96 | "liblog_event_list", |
| 97 | "liblog_rust", |
| 98 | "libthiserror", |
| 99 | ], |
| 100 | } |
| 101 | |
| 102 | rust_binary { |
| 103 | name: "diced", |
| 104 | srcs: ["src/diced_main.rs"], |
| 105 | rustlibs: [ |
| 106 | "libandroid_logger", |
| 107 | "libbinder_rs", |
| 108 | "libdiced", |
| 109 | "libdiced_open_dice_cbor", |
| 110 | "libdiced_utils", |
| 111 | "liblog_rust", |
| 112 | ], |
| 113 | init_rc: ["diced.rc"], |
| 114 | } |
| 115 | |
| 116 | rust_test { |
| 117 | name: "diced_test", |
| 118 | crate_name: "diced_test", |
| 119 | srcs: ["src/lib.rs"], |
| 120 | test_suites: ["general-tests"], |
| 121 | auto_gen_config: true, |
| 122 | rustlibs: [ |
| 123 | "android.hardware.security.dice-V1-rust", |
| 124 | "android.security.dice-rust", |
| 125 | "libanyhow", |
| 126 | "libbinder_rs", |
| 127 | "libdiced_open_dice_cbor", |
| 128 | "libdiced_utils", |
| 129 | "libkeystore2_crypto_rust", |
| 130 | "libkeystore2_selinux", |
| 131 | "libkeystore2_vintf_rust", |
| 132 | "liblibc", |
| 133 | "liblog_rust", |
| 134 | "libthiserror", |
| 135 | ], |
| 136 | } |