platform_build/tools/aconfig/Cargo.toml
Mårten Kongstad bb520729e8 aconfig: define Aconfig proto
Fill in aconfig.proto. Define Aconfig definitions (for introducing flags
and setting their values) and Overrides (for overriding flags regardless
of what their definitions say). More changes to the proto schema are
expected when more of the aconfig project is outlined.

Use proto2 instead of proto3: this will cause the protobuf text parser
to error on missing fields instead of returning a default value which is
ambiguous, especially for booleans. (Also, the text protobuf parser
doesn't provide good error messages: if the input is missing a field,
the error is always "1:1: Message not initialized").

Unfortunately the generated Rust wrappers around the proto structs land
in an external crate, which prevents aconfig from adding new impl
blocks. Circumvent this by converting the data read from proto into
structs defined in the aconfig crate.

Change main.rs to parse (static) text proto.

Also add dependency on anyhow.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I512e3b61ef20e2f55b7699a178d466d2a9a89eac
2023-05-04 10:35:25 +02:00

16 lines
226 B
TOML

[package]
name = "aconfig"
version = "0.1.0"
edition = "2021"
build = "build.rs"
[features]
default = ["cargo"]
cargo = []
[dependencies]
anyhow = "1.0.69"
protobuf = "3.2.0"
[build-dependencies]
protobuf-codegen = "3.2.0"