1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 12:23:46 +03:00
wezterm/build.rs
Wez Furlong 11b79827de Add script that can produce a full source tarball
Full means "including git submodules" and makes it easier for folks to
download and build a release without sucking down large repos from
various locations, especially for folks with bandwidth constraints.

Upload the source tarball to the associated release.

Refs: https://github.com/wez/wezterm/issues/81
Refs: https://github.com/wez/wezterm/pull/46
Refs: https://github.com/wez/wezterm/pull/48
2019-12-24 09:41:15 -08:00

23 lines
806 B
Rust

use vergen::{generate_cargo_keys, ConstantsFlags};
fn main() {
let mut flags = ConstantsFlags::all();
flags.remove(ConstantsFlags::SEMVER_FROM_CARGO_PKG);
// Generate the 'cargo:' key output
generate_cargo_keys(ConstantsFlags::all()).expect("Unable to generate the cargo keys!");
// If a file named `.tag` is present, we'll take its contents for the
// version number that we report in wezterm -h.
let mut ci_tag = String::new();
if let Ok(tag) = std::fs::read(".tag") {
if let Ok(s) = String::from_utf8(tag) {
ci_tag = s.trim().to_string();
println!("cargo:rerun-if-changed=.tag");
}
}
println!("cargo:rustc-env=WEZTERM_CI_TAG={}", ci_tag);
#[cfg(windows)]
embed_resource::compile("assets/windows/resource.rc");
}