blob: 4f9b7e14047cc6c29b0af7a2f1669225acab8006 [file] [log] [blame]
Paul Crowley9da969e2022-09-16 23:42:24 +00001// Copyright (C) 2022 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
15package {
Aditya Choudharyd987e9b2024-02-02 14:02:09 +000016 default_team: "trendy_team_java_core_libraries",
Paul Crowley9da969e2022-09-16 23:42:24 +000017 // See: http://go/android-license-faq
Paul Crowley9da969e2022-09-16 23:42:24 +000018 // SPDX-license-identifier-Apache-2.0
19 default_applicable_licenses: ["system_security_license"],
20}
21
22rust_bindgen {
23 name: "libcutils_socket_bindgen",
24 crate_name: "cutils_socket_bindgen",
25 wrapper_src: "cutils_wrapper.h",
26 source_stem: "bindings",
27 bindgen_flags: [
28 "--allowlist-function=android_get_control_socket",
29 ],
30 shared_libs: [
31 "libcutils",
32 ],
33}
34
Jiyong Parkeefd3512022-12-22 10:22:57 +090035rust_defaults {
36 name: "prng_seeder_defaults",
Paul Crowley9da969e2022-09-16 23:42:24 +000037 edition: "2021",
Paul Crowley9da969e2022-09-16 23:42:24 +000038 rustlibs: [
39 "libanyhow",
Maurice Lam47b4fac2023-12-18 22:14:32 +000040 "libbssl_sys",
Paul Crowley9da969e2022-09-16 23:42:24 +000041 "libclap",
42 "libcutils_socket_bindgen",
43 "liblogger",
44 "liblog_rust",
45 "libnix",
46 "libtokio",
47 ],
Pete Bentley812307d2022-09-22 15:29:13 +010048
49 init_rc: ["prng_seeder.rc"],
Paul Crowley9da969e2022-09-16 23:42:24 +000050}
Jiyong Parkeefd3512022-12-22 10:22:57 +090051
52rust_binary {
53 name: "prng_seeder",
54 defaults: ["prng_seeder_defaults"],
55 srcs: ["src/main.rs"],
56}
57
58rust_binary {
59 name: "prng_seeder_microdroid",
60 defaults: ["prng_seeder_defaults"],
61 srcs: ["src/main.rs"],
62 stem: "prng_seeder",
63 bootstrap: true,
64 installable: false,
65 prefer_rlib: true,
66}
Andrew Walbran13335de2022-12-01 15:05:39 +000067
68rust_test {
69 name: "prng_seeder.test",
70 edition: "2021",
71 srcs: ["src/main.rs"],
72 rustlibs: [
73 "libanyhow",
Maurice Lam47b4fac2023-12-18 22:14:32 +000074 "libbssl_sys",
Andrew Walbran13335de2022-12-01 15:05:39 +000075 "libclap",
76 "libcutils_socket_bindgen",
77 "liblogger",
78 "liblog_rust",
79 "libnix",
80 "libtokio",
81 ],
82 test_suites: ["general-tests"],
83}