blob: 8d0f4e7331fc847fbd293512e7427fecd6d6f7b6 [file] [log] [blame]
Janis Danisevskis43c89712020-08-03 23:42:42 +00001// Copyright 2020, 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
Bob Badour4c7858c2021-02-12 15:40:29 -080015package {
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
Paul Crowley7c57bf12021-02-02 16:26:57 -080024rust_defaults {
25 name: "libkeystore2_defaults",
Janis Danisevskis43c89712020-08-03 23:42:42 +000026 crate_name: "keystore2",
27 srcs: ["src/lib.rs"],
Janis Danisevskis7d77a762020-07-20 13:03:31 -070028
29 rustlibs: [
Jeongik Cha9f632c62021-01-23 09:33:35 +090030 "android.hardware.security.keymint-V1-rust",
31 "android.hardware.security.secureclock-V1-rust",
Janis Danisevskis84a83e42021-03-21 21:46:54 -070032 "android.hardware.security.sharedsecret-V1-rust",
Bram Bonné5d6c5102021-02-24 15:09:18 +010033 "android.os.permissions_aidl-rust",
Janis Danisevskis7a1cf382020-11-20 11:22:14 -080034 "android.security.apc-rust",
Janis Danisevskis9f10a6a2021-01-18 16:45:21 +000035 "android.security.authorization-rust",
Joel Galensonde386b42020-09-30 10:53:05 -070036 "android.security.compat-rust",
Janis Danisevskis34a0cf22021-03-08 09:19:03 -080037 "android.security.maintenance-rust",
Max Bires148c08e2020-10-13 13:41:41 -070038 "android.security.remoteprovisioning-rust",
Jeongik Cha9f632c62021-01-23 09:33:35 +090039 "android.system.keystore2-V1-rust",
Janis Danisevskis7d77a762020-07-20 13:03:31 -070040 "libanyhow",
Janis Danisevskise24f3472020-08-12 17:58:49 -070041 "libbinder_rs",
Joel Galensonba41ca32020-12-28 14:14:07 -080042 "libcutils_bindgen",
Janis Danisevskis212c68b2021-01-14 22:29:28 -080043 "libkeystore2_aaid-rust",
Janis Danisevskis7a1cf382020-11-20 11:22:14 -080044 "libkeystore2_apc_compat-rust",
Janis Danisevskisb42fc182020-12-15 08:41:27 -080045 "libkeystore2_crypto_rust",
Joel Galensonde386b42020-09-30 10:53:05 -070046 "libkeystore2_km_compat",
Janis Danisevskisce995432020-07-21 12:22:34 -070047 "libkeystore2_selinux",
Paul Crowley7c57bf12021-02-02 16:26:57 -080048 "libkeystore2_system_property-rust",
Janis Danisevskisef14e1a2021-02-23 23:16:55 -080049 "libkeystore2_vintf_rust",
Janis Danisevskis4ad056f2020-08-05 19:46:46 +000050 "liblazy_static",
Hasini Gunasinghe557b1032020-11-10 01:35:30 +000051 "liblibc",
Joel Galenson0891bc12020-07-20 10:37:03 -070052 "liblibsqlite3_sys",
Pavel Grafov94243c22021-04-21 18:03:11 +010053 "liblog_event_list",
Janis Danisevskis7d77a762020-07-20 13:03:31 -070054 "liblog_rust",
Joel Galenson0891bc12020-07-20 10:37:03 -070055 "librand",
Joel Galenson26f4d012020-07-17 14:57:21 -070056 "librusqlite",
Hasini Gunasingheb7142972021-02-20 03:11:27 +000057 "libstatslog_rust",
Seth Moore78c091f2021-04-09 21:38:30 +000058 "libstatslog_rust_header",
59 "libstatspull_rust",
Janis Danisevskis7d77a762020-07-20 13:03:31 -070060 "libthiserror",
61 ],
Joel Galensonba41ca32020-12-28 14:14:07 -080062 shared_libs: [
63 "libcutils",
64 ],
Janis Danisevskis43c89712020-08-03 23:42:42 +000065}
66
Janis Danisevskis2a8330a2021-01-20 15:34:26 -080067rust_library {
Paul Crowley7c57bf12021-02-02 16:26:57 -080068 name: "libkeystore2",
69 defaults: ["libkeystore2_defaults"],
70}
71
72rust_library {
Janis Danisevskis2a8330a2021-01-20 15:34:26 -080073 name: "libkeystore2_test_utils",
74 crate_name: "keystore2_test_utils",
75 srcs: ["test_utils/lib.rs"],
76 rustlibs: [
77 "liblog_rust",
78 "librand",
79 ]
80}
81
Janis Danisevskis43c89712020-08-03 23:42:42 +000082rust_test {
83 name: "keystore2_test",
Joel Galenson26f4d012020-07-17 14:57:21 -070084 crate_name: "keystore2",
Joel Galenson3f78dd82021-01-20 16:21:30 -080085 test_suites: ["general-tests"],
86 auto_gen_config: true,
Janis Danisevskis66784c42021-01-27 08:40:25 -080087 compile_multilib: "first",
Paul Crowley7c57bf12021-02-02 16:26:57 -080088 defaults: ["libkeystore2_defaults"],
Janis Danisevskis7d77a762020-07-20 13:03:31 -070089 rustlibs: [
90 "libandroid_logger",
Janis Danisevskis2a8330a2021-01-20 15:34:26 -080091 "libkeystore2_test_utils",
Janis Danisevskis5cb52dc2021-04-07 16:31:18 -070092 "libnix",
Janis Danisevskis7d77a762020-07-20 13:03:31 -070093 ],
Janis Danisevskis43c89712020-08-03 23:42:42 +000094}
Janis Danisevskis652f3812020-08-04 00:01:12 +000095
Janis Danisevskis1af91262020-08-10 14:58:08 -070096rust_binary {
97 name: "keystore2",
98 srcs: ["src/keystore2_main.rs"],
99 rustlibs: [
100 "libandroid_logger",
101 "libbinder_rs",
102 "libkeystore2",
103 "liblog_rust",
Janis Danisevskis77d72042021-01-20 15:36:30 -0800104 "libvpnprofilestore-rust",
Janis Danisevskis1af91262020-08-10 14:58:08 -0700105 ],
106 init_rc: ["keystore2.rc"],
Stephen Crane56936e82021-03-10 17:48:26 -0800107
108 vintf_fragments: ["android.system.keystore2-service.xml"],
Janis Danisevskis1af91262020-08-10 14:58:08 -0700109}