Bug: b/321077378 Test: atest aconfig_storage_file.test Change-Id: I1d48311cade178f0b047a5b4d4f81c6dac4362c8
116 lines
2.9 KiB
Plaintext
116 lines
2.9 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",
|
|
}
|
|
|
|
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",
|
|
}
|
|
|
|
cc_library_static {
|
|
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,
|
|
}
|
|
|
|
// 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,
|
|
srcs: ["src/lib.rs"],
|
|
defaults: ["aconfig_storage_file.defaults"],
|
|
}
|
|
|
|
// flag storage file cc interface
|
|
cc_library_static {
|
|
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"],
|
|
static_libs: [
|
|
"libbase",
|
|
],
|
|
}
|