• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 use std::env;
6 use std::path::PathBuf;
7 
main()8 fn main() {
9     let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
10     build_protos(&PathBuf::from(manifest_dir));
11 }
12 
build_protos(manifest_dir: &PathBuf)13 fn build_protos(manifest_dir: &PathBuf) {
14     let mut event_details_path = manifest_dir.to_owned();
15     event_details_path.extend(["protos", "event_details.proto"]);
16 
17     let mut out_dir = PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR env does not exist."));
18     // ANDROID: b/259142784 - we remove metrics_out subdir b/c cargo2android
19     // out_dir.push("metrics_protos");
20     proto_build_tools::build_protos(&out_dir, &[event_details_path]);
21 }
22