1## android-bp 2 3a rust crate to parse Android.bp files 4 5### Usage 6 7```rust 8 use android_bp::BluePrint; 9 10 let bp = BluePrint::from_file("fixtures/Android.bp").unwrap(); 11 println!("{:#?}", bp); 12 13 // variables are accessible as a rust HashMap 14 println!("{:#?}", bp.variables); 15 for m in &bp.modules { 16 if m.typ == "rust_binary" { 17 println!("{:?}", m.get("name").unwrap()); 18 } 19 } 20 // or iter them by type 21 for m in bp.modules_by_type("rust_host_test") { 22 // m.get return an sometime inconvenient Option<&Value> 23 // so some helper methods are provided 24 let name = m.get_string("name").unwrap(); 25 let srcs = m.get_array("srcs").unwrap(); 26 println!("{:?} {:?}", name, srcs); 27 } 28``` 29