aconfig: add project scaffolding
Introduce a new tool, aconfig, to manage build time configurations, such
as feature flags.
This CL adds a project skeleton. Later CLs will add the actual
implementation.
Note: there is no need for an explicit TEST_MAPPING file;
rust_test_host are automatically included in host-unit-tests and
explicitly adding these tests via TEST_MAPPING will cause an error.
Bug: 279485059
Test: m aconfig && aconfig
Test: atest aconfig.test
Change-Id: I94047a19a55ae4d45b4fd7a0c8105a91ddcdfd79
diff --git a/tools/aconfig/Android.bp b/tools/aconfig/Android.bp
new file mode 100644
index 0000000..b3813bf
--- /dev/null
+++ b/tools/aconfig/Android.bp
@@ -0,0 +1,33 @@
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+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",
+ "libprotobuf",
+ ],
+}
+
+rust_binary_host {
+ name: "aconfig",
+ defaults: ["aconfig.defaults"],
+}
+
+rust_test_host {
+ name: "aconfig.test",
+ defaults: ["aconfig.defaults"],
+}