make build process a bit more transparent

- print help messages when running svd2utra from command line for
development
- do not allow utra to silently fall back to a default if one
has not been specified in the environment
This commit is contained in:
bunnie 2020-10-06 00:48:34 +08:00
parent c5d8ccc67c
commit 7dc011e6d8
2 changed files with 3 additions and 1 deletions

View file

@ -4,6 +4,8 @@ use generate::*;
use std::fs::File;
fn main() {
println!("Generating using examples/soc.svd, output is example.rs (this stub is for testing only!)");
println!("Use `cargo xtask ci <path-to-svdfile>` to generate a final SVD file.");
let src = File::open("examples/soc.svd").unwrap();
let mut dest = File::create("example.rs").unwrap();
generate(src, &mut dest).unwrap();

View file

@ -1,7 +1,7 @@
use std::env;
fn main() {
let svd_file = env::var("XOUS_SVD_FILE").unwrap_or("../emulation/example.svd".to_owned());
let svd_file = env::var("XOUS_SVD_FILE").expect("Set the environment variable `XOUS_SVD_FILE` to point to an SVD file");
println!("cargo:rerun-if-env-changed=XOUS_SVD_FILE");
println!("cargo:rerun-if-env-changed={}", svd_file);