1// Copyright (C) 2024 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
15rust_defaults {
16    name: "aconfigd_rust.defaults",
17    edition: "2021",
18    lints: "none",
19    rustlibs: [
20        "libaconfig_storage_file",
21        "libaconfig_storage_read_api",
22        "libaconfig_storage_write_api",
23        "libaconfigd_protos_rust",
24        "libanyhow",
25        "libclap",
26        "libmemmap2",
27        "libopenssl",
28        "liblog_rust",
29        "libprotobuf",
30        "libthiserror",
31        "librustutils",
32    ],
33    apex_available: [
34        "com.android.configinfrastructure",
35        "//apex_available:platform",
36    ],
37    min_sdk_version: "34",
38}
39
40rust_library {
41    name: "libaconfigd_rust",
42    crate_name: "aconfigd_rust",
43    defaults: ["aconfigd_rust.defaults"],
44    srcs: ["src/lib.rs"],
45}
46
47rust_binary {
48    name: "aconfigd-mainline",
49    defaults: ["aconfigd_rust.defaults"],
50    srcs: ["src/main.rs"],
51    rustlibs: [
52        "libaconfigd_rust",
53        "libandroid_logger",
54        "liblibc",
55        "libaconfig_new_storage_flags_rust",
56    ],
57}
58
59rust_test {
60    name: "libaconfigd_rust.test",
61    team: "trendy_team_android_core_experiments",
62    test_suites: [
63        "general-tests",
64    ],
65    defaults: ["aconfigd_rust.defaults"],
66    srcs: ["src/lib.rs"],
67    rustlibs: [
68        "libtempfile",
69    ],
70    data: [
71        "./tests/data/package.map",
72        "./tests/data/flag.map",
73        "./tests/data/flag.val",
74        "./tests/data/flag.info",
75        "./tests/data/container_with_more_flags.package.map",
76        "./tests/data/container_with_more_flags.flag.map",
77        "./tests/data/container_with_more_flags.flag.val",
78        "./tests/data/container_with_more_flags.flag.info",
79    ],
80    require_root: true
81}
82