mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
20 lines
592 B
Rust
20 lines
592 B
Rust
extern crate rand;
|
|
extern crate vergen;
|
|
|
|
use rand::distributions::Alphanumeric;
|
|
use rand::Rng;
|
|
use vergen::{generate_cargo_keys, ConstantsFlags};
|
|
|
|
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!");
|
|
|
|
let mut rng = rand::thread_rng();
|
|
let build_id: String = ::std::iter::repeat(())
|
|
.map(|()| rng.sample(Alphanumeric))
|
|
.take(8)
|
|
.collect();
|
|
|
|
println!("cargo:rustc-env=LIBRESPOT_BUILD_ID={}", build_id);
|
|
}
|