crosvm/plugin_proto/build.rs
David Tolnay 2bac1e7a9c toolchain: Update to Rust 1.31.0
We updated the production toolchain from 1.30 to 1.31 in CL:1366446.
This CL does the same upgrade for the local developer toolchain and
Kokoro.

The relevant changes are in rust-toolchain and kokoro/Dockerfile.
The rest are from rustfmt.

TEST=cargo fmt --all -- --check
TEST=as described in kokoro/README.md

Change-Id: I3b4913f3e237baa36c664b4953be360c09efffd4
Reviewed-on: https://chromium-review.googlesource.com/1374376
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-12-13 19:28:04 -08:00

30 lines
801 B
Rust

// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
extern crate protoc_rust;
use std::env;
use std::fs;
use std::io::Write;
use std::path::PathBuf;
fn main() {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
protoc_rust::run(protoc_rust::Args {
out_dir: out_dir.as_os_str().to_str().unwrap(),
input: &["protos/plugin.proto"],
includes: &["protos"],
})
.expect("protoc");
let mut mod_out = fs::File::create(out_dir.join("proto_include.rs")).unwrap();
writeln!(
mod_out,
"#[path = \"{}\"] pub mod plugin_proto;\npub use plugin_proto::*;",
out_dir.join("plugin.rs").display()
)
.unwrap();
}