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_new_storage_flags_rust", 21 "libaconfig_storage_file", 22 "libaconfig_storage_read_api", 23 "libaconfig_storage_write_api", 24 "libaconfigd_protos_rust", 25 "libanyhow", 26 "libclap", 27 "libconfiginfra_framework_flags_rust", 28 "libmemmap2", 29 "libopenssl", 30 "liblog_rust", 31 "libprotobuf", 32 "libthiserror", 33 "librustutils", 34 ], 35 apex_available: [ 36 "com.android.configinfrastructure", 37 "//apex_available:platform", 38 ], 39 min_sdk_version: "34", 40} 41 42rust_library { 43 name: "libaconfigd_rust", 44 crate_name: "aconfigd_rust", 45 defaults: ["aconfigd_rust.defaults"], 46 srcs: ["src/lib.rs"], 47} 48 49rust_binary { 50 name: "aconfigd-mainline", 51 defaults: ["aconfigd_rust.defaults"], 52 srcs: ["src/main.rs"], 53 rustlibs: [ 54 "libaconfigd_rust", 55 "libandroid_logger", 56 "liblibc", 57 "libaconfig_new_storage_flags_rust", 58 ], 59 cfgs: select(release_flag("RELEASE_ENABLE_MAINLINE_ACONFIGD_SOCKET"), { 60 true: ["enable_mainline_aconfigd_socket"], 61 default: [], 62 }), 63} 64 65rust_test { 66 name: "libaconfigd_rust.test", 67 team: "trendy_team_android_core_experiments", 68 test_suites: [ 69 "general-tests", 70 "mts-configinfrastructure", 71 ], 72 defaults: ["aconfigd_rust.defaults"], 73 srcs: ["src/lib.rs"], 74 rustlibs: [ 75 "libtempfile", 76 ], 77 data: [ 78 "./tests/data/package.map", 79 "./tests/data/flag.map", 80 "./tests/data/flag.val", 81 "./tests/data/flag.info", 82 "./tests/data/container_with_more_flags.package.map", 83 "./tests/data/container_with_more_flags.flag.map", 84 "./tests/data/container_with_more_flags.flag.val", 85 "./tests/data/container_with_more_flags.flag.info", 86 ], 87 require_root: true 88} 89 90rust_aconfig_library { 91 name: "libconfiginfra_framework_flags_rust", 92 crate_name: "configinfra_framework_flags_rust", 93 aconfig_declarations: "configinfra_framework_flags", 94 apex_available: [ 95 "com.android.configinfrastructure", 96 "//apex_available:platform", 97 ], 98 min_sdk_version: "34", 99} 100