librespot/core/build.rs

20 lines
588 B
Rust
Raw Normal View History

2017-08-03 18:58:44 +00:00
extern crate rand;
2018-02-11 11:37:08 +00:00
extern crate vergen;
2017-08-03 18:58:44 +00:00
2019-01-17 07:59:25 +00:00
use rand::distributions::Alphanumeric;
use rand::Rng;
use vergen::{generate_cargo_keys, ConstantsFlags};
2017-08-03 18:58:44 +00:00
fn main() {
let mut flags = ConstantsFlags::all();
flags.toggle(ConstantsFlags::REBUILD_ON_HEAD_CHANGE);
generate_cargo_keys(ConstantsFlags::all()).expect("Unable to generate the cargo keys!");
2017-08-03 18:58:44 +00:00
2019-01-17 07:59:25 +00:00
let mut rng = rand::thread_rng();
let build_id: String = ::std::iter::repeat(())
.map(|()| rng.sample(Alphanumeric))
.take(8)
.collect();
println!("cargo:rustc-env=VERGEN_BUILD_ID={}", build_id);
2017-08-03 18:58:44 +00:00
}