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

Commit 672af952 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "aconfig: create aconfig_storage_write_api crate" into main

parents cae6e565 7e5fca58
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"
]
+4 −0
Original line number Diff line number Diff line
@@ -69,6 +69,10 @@
    }
  ],
  "postsubmit": [
    {
      // aconfig_storage_write_api unit tests
      "name": "aconfig_storage_write_api.test"
    },
    {
      // aconfig_storage_read_api unit tests
      "name": "aconfig_storage_read_api.test"
+6 −0
Original line number Diff line number Diff line
@@ -163,6 +163,12 @@ pub enum AconfigStorageError {
    #[error("fail to map storage file")]
    MapFileFail(#[source] anyhow::Error),

    #[error("fail to get mapped file")]
    ObtainMappedFileFail(#[source] anyhow::Error),

    #[error("fail to flush mapped storage file")]
    MapFlushFail(#[source] anyhow::Error),

    #[error("number of items in hash table exceed limit")]
    HashTableSizeLimit(#[source] anyhow::Error),

+37 −0
Original line number Diff line number Diff line
package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

rust_defaults {
    name: "aconfig_storage_write_api.defaults",
    edition: "2021",
    lints: "none",
    srcs: ["src/lib.rs"],
    rustlibs: [
        "libanyhow",
        "libtempfile",
        "libmemmap2",
        "libcxx",
        "libthiserror",
        "libaconfig_storage_file",
    ],
}

rust_library {
    name: "libaconfig_storage_write_api",
    crate_name: "aconfig_storage_write_api",
    host_supported: true,
    defaults: ["aconfig_storage_write_api.defaults"],
}

rust_test_host {
    name: "aconfig_storage_write_api.test",
    test_suites: ["general-tests"],
    defaults: ["aconfig_storage_write_api.defaults"],
    data: [
        "tests/flag.val",
    ],
    rustlibs: [
        "libaconfig_storage_read_api",
    ],
}
+21 −0
Original line number Diff line number Diff line
[package]
name = "aconfig_storage_write_api"
version = "0.1.0"
edition = "2021"

[features]
default = ["cargo"]
cargo = []

[dependencies]
anyhow = "1.0.69"
memmap2 = "0.8.0"
tempfile = "3.9.0"
thiserror = "1.0.56"
protobuf = "3.2.0"
once_cell = "1.19.0"
aconfig_storage_file = { path = "../aconfig_storage_file" }
aconfig_storage_read_api = { path = "../aconfig_storage_read_api" }

[build-dependencies]
cxx-build = "1.0"
Loading