2023-04-25 15:06:30 +02:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
}
|
|
|
|
|
2023-07-04 17:30:09 +02:00
|
|
|
// proto libraries for consumers of `aconfig dump --format=protobuf` output
|
|
|
|
|
|
|
|
java_library {
|
|
|
|
name: "libaconfig_java_proto_lite",
|
|
|
|
host_supported: true,
|
|
|
|
srcs: ["protos/aconfig.proto"],
|
|
|
|
static_libs: ["libprotobuf-java-lite"],
|
|
|
|
proto: {
|
|
|
|
type: "lite",
|
|
|
|
},
|
|
|
|
sdk_version: "current",
|
|
|
|
}
|
|
|
|
|
|
|
|
java_library_host {
|
|
|
|
name: "libaconfig_java_proto_full",
|
|
|
|
srcs: ["protos/aconfig.proto"],
|
|
|
|
static_libs: ["libprotobuf-java-full"],
|
|
|
|
proto: {
|
|
|
|
type: "full",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-08-25 01:47:08 +02:00
|
|
|
python_library_host {
|
|
|
|
name: "libaconfig_python_proto",
|
|
|
|
srcs: ["protos/aconfig.proto"],
|
|
|
|
proto: {
|
|
|
|
canonical_path_from_root: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-05-30 11:15:02 +02:00
|
|
|
// host binary: aconfig
|
|
|
|
|
2023-04-25 15:06:30 +02:00
|
|
|
rust_protobuf_host {
|
|
|
|
name: "libaconfig_protos",
|
|
|
|
protos: ["protos/aconfig.proto"],
|
|
|
|
crate_name: "aconfig_protos",
|
|
|
|
source_stem: "aconfig_protos",
|
|
|
|
use_protobuf3: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_defaults {
|
|
|
|
name: "aconfig.defaults",
|
|
|
|
edition: "2021",
|
|
|
|
clippy_lints: "android",
|
|
|
|
lints: "android",
|
|
|
|
srcs: ["src/main.rs"],
|
|
|
|
rustlibs: [
|
|
|
|
"libaconfig_protos",
|
2023-04-26 13:16:41 +02:00
|
|
|
"libanyhow",
|
2023-04-27 16:05:58 +02:00
|
|
|
"libclap",
|
2023-04-25 15:06:30 +02:00
|
|
|
"libprotobuf",
|
2023-04-27 16:05:58 +02:00
|
|
|
"libserde",
|
|
|
|
"libserde_json",
|
2023-05-10 06:02:33 +02:00
|
|
|
"libtinytemplate",
|
2023-04-25 15:06:30 +02:00
|
|
|
],
|
2023-06-22 10:12:24 +02:00
|
|
|
proc_macros: [
|
|
|
|
"libpaste",
|
|
|
|
]
|
2023-04-25 15:06:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
rust_binary_host {
|
|
|
|
name: "aconfig",
|
|
|
|
defaults: ["aconfig.defaults"],
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_test_host {
|
|
|
|
name: "aconfig.test",
|
|
|
|
defaults: ["aconfig.defaults"],
|
2023-06-08 10:15:43 +02:00
|
|
|
rustlibs: [
|
|
|
|
"libitertools",
|
|
|
|
],
|
2023-04-25 15:06:30 +02:00
|
|
|
}
|
2023-05-30 11:15:02 +02:00
|
|
|
|
2023-07-24 11:10:00 +02:00
|
|
|
// integration tests: general
|
2023-05-30 11:15:02 +02:00
|
|
|
|
2023-06-22 00:17:42 +02:00
|
|
|
aconfig_declarations {
|
2023-05-30 11:15:02 +02:00
|
|
|
name: "aconfig.test.flags",
|
2023-06-22 00:17:42 +02:00
|
|
|
package: "com.android.aconfig.test",
|
2023-05-30 11:15:02 +02:00
|
|
|
srcs: ["tests/test.aconfig"],
|
|
|
|
}
|
|
|
|
|
2023-06-22 00:17:42 +02:00
|
|
|
aconfig_values {
|
2023-05-30 11:15:02 +02:00
|
|
|
name: "aconfig.test.flag.values",
|
2023-06-22 00:17:42 +02:00
|
|
|
package: "com.android.aconfig.test",
|
2023-05-30 11:15:02 +02:00
|
|
|
srcs: [
|
|
|
|
"tests/first.values",
|
|
|
|
"tests/second.values",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2023-06-22 00:17:42 +02:00
|
|
|
aconfig_value_set {
|
2023-05-30 11:15:02 +02:00
|
|
|
name: "aconfig.test.flag.value_set",
|
|
|
|
values: [
|
|
|
|
"aconfig.test.flag.values",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2023-07-24 11:10:00 +02:00
|
|
|
// integration tests: java
|
|
|
|
|
2023-06-22 00:17:42 +02:00
|
|
|
java_aconfig_library {
|
2023-07-24 11:10:00 +02:00
|
|
|
name: "aconfig_test_java_library",
|
2023-06-22 00:17:42 +02:00
|
|
|
aconfig_declarations: "aconfig.test.flags",
|
2023-06-09 22:38:43 +02:00
|
|
|
}
|
|
|
|
|
2023-05-30 11:15:02 +02:00
|
|
|
android_test {
|
|
|
|
name: "aconfig.test.java",
|
|
|
|
srcs: [
|
2023-08-07 20:09:28 +02:00
|
|
|
"tests/AconfigTest.java",
|
2023-05-30 11:15:02 +02:00
|
|
|
],
|
|
|
|
manifest: "tests/AndroidManifest.xml",
|
|
|
|
certificate: "platform",
|
|
|
|
static_libs: [
|
2023-07-24 11:10:00 +02:00
|
|
|
"aconfig_test_java_library",
|
2023-05-30 11:15:02 +02:00
|
|
|
"androidx.test.rules",
|
|
|
|
"testng",
|
|
|
|
],
|
|
|
|
test_suites: ["device-tests"],
|
|
|
|
}
|
2023-07-24 11:10:00 +02:00
|
|
|
|
2023-08-07 20:09:28 +02:00
|
|
|
java_aconfig_library {
|
|
|
|
name: "aconfig_host_test_java_library",
|
|
|
|
aconfig_declarations: "aconfig.test.flags",
|
|
|
|
host_supported: true,
|
|
|
|
test: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
java_test_host {
|
|
|
|
name: "AconfigJavaHostTest",
|
|
|
|
srcs: [
|
|
|
|
"tests/AconfigHostTest.java",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"aconfig_host_test_java_library",
|
|
|
|
"junit",
|
|
|
|
],
|
|
|
|
test_suites: ["general-tests"],
|
|
|
|
}
|
|
|
|
|
2023-07-24 11:10:00 +02:00
|
|
|
// integration tests: C++
|
|
|
|
|
|
|
|
cc_aconfig_library {
|
|
|
|
name: "aconfig_test_cpp_library",
|
|
|
|
aconfig_declarations: "aconfig.test.flags",
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "aconfig.test.cpp",
|
|
|
|
srcs: [
|
|
|
|
"tests/aconfig_test.cpp",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"aconfig_test_cpp_library",
|
|
|
|
"libgmock",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"server_configurable_flags",
|
|
|
|
],
|
|
|
|
}
|
2023-08-02 23:15:58 +02:00
|
|
|
|
|
|
|
rust_aconfig_library {
|
|
|
|
name: "libaconfig_test_rust_library",
|
|
|
|
crate_name: "aconfig_test_rust_library",
|
|
|
|
aconfig_declarations: "aconfig.test.flags",
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_test {
|
2023-08-11 23:34:12 +02:00
|
|
|
name: "aconfig.prod_mode.test.rust",
|
2023-08-02 23:15:58 +02:00
|
|
|
srcs: [
|
2023-08-11 23:34:12 +02:00
|
|
|
"tests/aconfig_prod_mode_test.rs"
|
2023-08-02 23:15:58 +02:00
|
|
|
],
|
|
|
|
rustlibs: [
|
|
|
|
"libaconfig_test_rust_library",
|
|
|
|
],
|
2023-08-11 23:34:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
rust_aconfig_library {
|
|
|
|
name: "libaconfig_test_rust_library_with_test_mode",
|
|
|
|
crate_name: "aconfig_test_rust_library",
|
|
|
|
aconfig_declarations: "aconfig.test.flags",
|
|
|
|
test: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_test {
|
|
|
|
name: "aconfig.test_mode.test.rust",
|
|
|
|
srcs: [
|
|
|
|
"tests/aconfig_test_mode_test.rs"
|
|
|
|
],
|
|
|
|
rustlibs: [
|
|
|
|
"libaconfig_test_rust_library_with_test_mode",
|
|
|
|
],
|
2023-08-02 23:15:58 +02:00
|
|
|
}
|