2022-09-13 17:55:17 +00:00
|
|
|
// Copyright 2022 The ChromiumOS Authors
|
2022-05-23 20:18:04 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2022-07-27 18:11:32 +00:00
|
|
|
use std::env;
|
2022-05-23 20:18:04 +00:00
|
|
|
use std::path::PathBuf;
|
2022-07-27 18:11:32 +00:00
|
|
|
|
2022-05-23 20:18:04 +00:00
|
|
|
fn main() {
|
2022-11-10 21:23:26 +00:00
|
|
|
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
|
|
build_protos(&PathBuf::from(manifest_dir));
|
2022-05-23 20:18:04 +00:00
|
|
|
}
|
|
|
|
|
2022-11-10 21:23:26 +00:00
|
|
|
fn build_protos(manifest_dir: &PathBuf) {
|
|
|
|
let mut event_details_path = manifest_dir.to_owned();
|
|
|
|
event_details_path.extend(["protos", "event_details.proto"]);
|
2022-05-23 20:18:04 +00:00
|
|
|
|
2022-11-10 21:23:26 +00:00
|
|
|
let mut out_dir = PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR env does not exist."));
|
|
|
|
out_dir.push("metrics_protos");
|
|
|
|
proto_build_tools::build_protos(&out_dir, &[event_details_path]);
|
2022-05-23 20:18:04 +00:00
|
|
|
}
|