Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bca2f3c2 authored by Dennis Shen's avatar Dennis Shen
Browse files

aconfig: move aconfig_storage_metadata proto and its apis to

aconfig_storage_file crate

Bug: b/321077378
Test: m aconfig_storage_file.test; m aconfig_storage_read_api.test
Change-Id: Ifeeeff62dc09e172b7e88c45860d2febccc29570
parent 0329cda7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ members = [
    "aconfig_protos",
    "aconfig_storage_file",
    "aconfig_storage_read_api",
    "aconfig_storage_write_api",
    "aflags",
    "printflags"
]
+25 −0
Original line number Diff line number Diff line
@@ -11,6 +11,9 @@ rust_defaults {
        "libanyhow",
        "libthiserror",
        "libtempfile",
        "libprotobuf",
        "libclap",
        "libaconfig_storage_protos",
    ],
}

@@ -26,3 +29,25 @@ rust_test_host {
    test_suites: ["general-tests"],
    defaults: ["aconfig_storage_file.defaults"],
}

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,
}

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,
}
+0 −3
Original line number Diff line number Diff line
@@ -9,11 +9,8 @@ cargo = []

[dependencies]
anyhow = "1.0.69"
memmap2 = "0.8.0"
protobuf = "3.2.0"
once_cell = "1.19.0"
tempfile = "3.9.0"
cxx = "1.0"
thiserror = "1.0.56"
clap = { version = "4.1.8", features = ["derive"] }

+17 −0
Original line number Diff line number Diff line
use protobuf_codegen::Codegen;

fn main() {
    let proto_files = vec!["protos/aconfig_storage_metadata.proto"];

    // tell cargo to only re-run the build script if any of the proto files has changed
    for path in &proto_files {
        println!("cargo:rerun-if-changed={}", path);
    }

    Codegen::new()
        .pure()
        .include("protos")
        .inputs(proto_files)
        .cargo_out_dir("aconfig_storage_protos")
        .run_from_script();
}
Loading