blob: 273bdd76583bbc4279c45115192f2c4fa492e7e8 [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",
Bram Bonné5d6c5102021-02-24 15:09:18 +010032 "android.os.permissions_aidl-rust",
Janis Danisevskis7a1cf382020-11-20 11:22:14 -080033 "android.security.apc-rust",
Janis Danisevskis9f10a6a2021-01-18 16:45:21 +000034 "android.security.authorization-rust",
Joel Galensonde386b42020-09-30 10:53:05 -070035 "android.security.compat-rust",
Janis Danisevskis34a0cf22021-03-08 09:19:03 -080036 "android.security.maintenance-rust",
Max Bires148c08e2020-10-13 13:41:41 -070037 "android.security.remoteprovisioning-rust",
Jeongik Cha9f632c62021-01-23 09:33:35 +090038 "android.system.keystore2-V1-rust",
Janis Danisevskis7d77a762020-07-20 13:03:31 -070039 "libanyhow",
Janis Danisevskise24f3472020-08-12 17:58:49 -070040 "libbinder_rs",
Janis Danisevskis212c68b2021-01-14 22:29:28 -080041 "libkeystore2_aaid-rust",
Janis Danisevskis7a1cf382020-11-20 11:22:14 -080042 "libkeystore2_apc_compat-rust",
Janis Danisevskisb42fc182020-12-15 08:41:27 -080043 "libkeystore2_crypto_rust",
Joel Galensonde386b42020-09-30 10:53:05 -070044 "libkeystore2_km_compat",
Janis Danisevskisce995432020-07-21 12:22:34 -070045 "libkeystore2_selinux",
Paul Crowley7c57bf12021-02-02 16:26:57 -080046 "libkeystore2_system_property-rust",
Janis Danisevskisef14e1a2021-02-23 23:16:55 -080047 "libkeystore2_vintf_rust",
Janis Danisevskis4ad056f2020-08-05 19:46:46 +000048 "liblazy_static",
Hasini Gunasinghe557b1032020-11-10 01:35:30 +000049 "liblibc",
Joel Galenson0891bc12020-07-20 10:37:03 -070050 "liblibsqlite3_sys",
Janis Danisevskis7d77a762020-07-20 13:03:31 -070051 "liblog_rust",
Joel Galenson0891bc12020-07-20 10:37:03 -070052 "librand",
Joel Galenson26f4d012020-07-17 14:57:21 -070053 "librusqlite",
Janis Danisevskis7d77a762020-07-20 13:03:31 -070054 "libthiserror",
55 ],
Janis Danisevskis43c89712020-08-03 23:42:42 +000056}
57
Janis Danisevskis2a8330a2021-01-20 15:34:26 -080058rust_library {
Paul Crowley7c57bf12021-02-02 16:26:57 -080059 name: "libkeystore2",
60 defaults: ["libkeystore2_defaults"],
61}
62
63rust_library {
Janis Danisevskis2a8330a2021-01-20 15:34:26 -080064 name: "libkeystore2_test_utils",
65 crate_name: "keystore2_test_utils",
66 srcs: ["test_utils/lib.rs"],
67 rustlibs: [
68 "liblog_rust",
69 "librand",
70 ]
71}
72
Janis Danisevskis43c89712020-08-03 23:42:42 +000073rust_test {
74 name: "keystore2_test",
Joel Galenson26f4d012020-07-17 14:57:21 -070075 crate_name: "keystore2",
Joel Galenson3f78dd82021-01-20 16:21:30 -080076 test_suites: ["general-tests"],
77 auto_gen_config: true,
Janis Danisevskis66784c42021-01-27 08:40:25 -080078 compile_multilib: "first",
Paul Crowley7c57bf12021-02-02 16:26:57 -080079 defaults: ["libkeystore2_defaults"],
Janis Danisevskis7d77a762020-07-20 13:03:31 -070080 rustlibs: [
81 "libandroid_logger",
Janis Danisevskis2a8330a2021-01-20 15:34:26 -080082 "libkeystore2_test_utils",
Janis Danisevskis7d77a762020-07-20 13:03:31 -070083 ],
Janis Danisevskis43c89712020-08-03 23:42:42 +000084}
Janis Danisevskis652f3812020-08-04 00:01:12 +000085
Janis Danisevskis1af91262020-08-10 14:58:08 -070086rust_binary {
87 name: "keystore2",
88 srcs: ["src/keystore2_main.rs"],
89 rustlibs: [
90 "libandroid_logger",
91 "libbinder_rs",
92 "libkeystore2",
93 "liblog_rust",
Janis Danisevskis77d72042021-01-20 15:36:30 -080094 "libvpnprofilestore-rust",
Janis Danisevskis1af91262020-08-10 14:58:08 -070095 ],
96 init_rc: ["keystore2.rc"],
Stephen Crane56936e82021-03-10 17:48:26 -080097
98 vintf_fragments: ["android.system.keystore2-service.xml"],
Janis Danisevskis1af91262020-08-10 14:58:08 -070099}