xref: /aosp_15_r20/build/make/tools/aconfig/aconfig_protos/build.rs (revision 9e94795a3d4ef5c1d47486f9a02bb378756cea8a)
1*9e94795aSAndroid Build Coastguard Worker use protobuf_codegen::Codegen;
2*9e94795aSAndroid Build Coastguard Worker 
main()3*9e94795aSAndroid Build Coastguard Worker fn main() {
4*9e94795aSAndroid Build Coastguard Worker     let proto_files = vec!["protos/aconfig.proto"];
5*9e94795aSAndroid Build Coastguard Worker 
6*9e94795aSAndroid Build Coastguard Worker     // tell cargo to only re-run the build script if any of the proto files has changed
7*9e94795aSAndroid Build Coastguard Worker     for path in &proto_files {
8*9e94795aSAndroid Build Coastguard Worker         println!("cargo:rerun-if-changed={}", path);
9*9e94795aSAndroid Build Coastguard Worker     }
10*9e94795aSAndroid Build Coastguard Worker 
11*9e94795aSAndroid Build Coastguard Worker     Codegen::new()
12*9e94795aSAndroid Build Coastguard Worker         .pure()
13*9e94795aSAndroid Build Coastguard Worker         .include("protos")
14*9e94795aSAndroid Build Coastguard Worker         .inputs(proto_files)
15*9e94795aSAndroid Build Coastguard Worker         .cargo_out_dir("aconfig_proto")
16*9e94795aSAndroid Build Coastguard Worker         .run_from_script();
17*9e94795aSAndroid Build Coastguard Worker }
18