Files
build/tools/aconfig/aconfig_storage_file/Android.bp
Dennis Shen 45c94c6421 aconfig: add a new aconfig storage file flag listing api
added a new function called list_flag_with_info to list all the flags
given all four storage files (package.map, flag.map, flag.val, flag.info).
also exported this api thru cxx interface so aconfigd can use it.

Bug: b/312444587
Test: atest -c
Change-Id: Ibbfe657b980d40e25e5e28962b930338192e2d98
2024-04-30 17:52:44 +00:00

140 lines
3.5 KiB
Plaintext

package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
rust_defaults {
name: "aconfig_storage_file.defaults",
edition: "2021",
lints: "none",
rustlibs: [
"libanyhow",
"libthiserror",
"libtempfile",
"libprotobuf",
"libclap",
"libcxx",
"libaconfig_storage_protos",
],
}
rust_library {
name: "libaconfig_storage_file",
crate_name: "aconfig_storage_file",
host_supported: true,
defaults: ["aconfig_storage_file.defaults"],
srcs: ["src/lib.rs"],
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
min_sdk_version: "29",
vendor_available: true,
product_available: true,
}
rust_binary_host {
name: "aconfig-storage",
defaults: ["aconfig_storage_file.defaults"],
srcs: ["src/main.rs"],
rustlibs: ["libaconfig_storage_file"],
}
rust_test_host {
name: "aconfig_storage_file.test",
test_suites: ["general-tests"],
defaults: ["aconfig_storage_file.defaults"],
srcs: ["src/lib.rs"],
}
rust_protobuf {
name: "libaconfig_storage_protos",
protos: ["protos/aconfig_storage_metadata.proto"],
crate_name: "aconfig_storage_protos",
source_stem: "aconfig_storage_protos",
host_supported: true,
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
min_sdk_version: "29",
vendor_available: true,
product_available: true,
}
cc_library {
name: "libaconfig_storage_protos_cc",
proto: {
export_proto_headers: true,
type: "lite",
},
srcs: ["protos/aconfig_storage_metadata.proto"],
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
host_supported: true,
min_sdk_version: "29",
vendor_available: true,
product_available: true,
double_loadable: true,
}
// cxx source codegen from rust api
genrule {
name: "libcxx_aconfig_storage_file_bridge_code",
tools: ["cxxbridge"],
cmd: "$(location cxxbridge) $(in) > $(out)",
srcs: ["src/lib.rs"],
out: ["aconfig_storage/lib.rs.cc"],
}
// cxx header codegen from rust api
genrule {
name: "libcxx_aconfig_storage_file_bridge_header",
tools: ["cxxbridge"],
cmd: "$(location cxxbridge) $(in) --header > $(out)",
srcs: ["src/lib.rs"],
out: ["aconfig_storage/lib.rs.h"],
}
// a static cc lib based on generated code
rust_ffi_static {
name: "libaconfig_storage_file_cxx_bridge",
crate_name: "aconfig_storage_file_cxx_bridge",
host_supported: true,
vendor_available: true,
product_available: true,
srcs: ["src/lib.rs"],
defaults: ["aconfig_storage_file.defaults"],
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
min_sdk_version: "29",
}
// storage file parse api cc interface
cc_library {
name: "libaconfig_storage_file_cc",
srcs: ["aconfig_storage_file.cpp"],
generated_headers: [
"cxx-bridge-header",
"libcxx_aconfig_storage_file_bridge_header",
],
generated_sources: ["libcxx_aconfig_storage_file_bridge_code"],
whole_static_libs: ["libaconfig_storage_file_cxx_bridge"],
export_include_dirs: ["include"],
host_supported: true,
vendor_available: true,
product_available: true,
shared_libs: [
"libbase",
],
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
min_sdk_version: "29",
double_loadable: true,
}