android-bp
a rust crate to parse Android.bp files
Usage
use BluePrint;
let bp = from_file.unwrap;
println!;
// variables are accessible as a rust HashMap
println!;
for m in &bp.modules
// or iter them by type
for m in bp.modules_by_type
Status
-
The project parses successfully all the Android.bp files in the AOSP tree. Test files are present in the src/test_db.tar.xz archive.
-
different possible values are abstracted in the
Valueenum- strings
- arrays
- integers
- booleans
- expressions
- functions
- identifiers
-
modules (
module { ... }) -
variables (
var = "value") -
variables extend (
var += [ "new value" ])- arrays
- strings
- integers
- expressions with other variables
-
expressions (
var : "value" + \n"value"), used for strings long enough to be split in multiple lines- arrays (automatically merged)
- strings (automatically merged)
- with identifiers (kept as an expression)