- inline mac, windows, linux bundling in the cli - remove tauri bundle from our dep tree - trim down the rpm crate for fewer dependencies in tree - migrate from blacksmith to warpbuild - move off swc and instead use esbuild via tool - use dev drives in windows CI - use fork of nix action for faster caching - test bundling in CI - fix asset handling in linux - add default APPDATA location for webview2 installs for dioxus apps on windows
43 lines
1.1 KiB
Rust
43 lines
1.1 KiB
Rust
use std::process::Command;
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-env-changed=DIOXUS_CLI_GIT_SHA");
|
|
println!("cargo:rerun-if-env-changed=DIOXUS_CLI_GIT_SHA_SHORT");
|
|
println!("cargo:rerun-if-changed=.git/HEAD");
|
|
println!("cargo:rerun-if-changed=.git/refs");
|
|
|
|
let full_hash = std::env::var("DIOXUS_CLI_GIT_SHA")
|
|
.ok()
|
|
.or_else(resolve_git_commit_hash);
|
|
|
|
if let Some(full_hash) = full_hash {
|
|
println!("cargo:rustc-env=DIOXUS_CLI_GIT_SHA={full_hash}");
|
|
|
|
let short_hash = std::env::var("DIOXUS_CLI_GIT_SHA_SHORT")
|
|
.ok()
|
|
.unwrap_or_else(|| full_hash.chars().take(7).collect());
|
|
|
|
println!("cargo:rustc-env=DIOXUS_CLI_GIT_SHA_SHORT={short_hash}");
|
|
}
|
|
}
|
|
|
|
fn resolve_git_commit_hash() -> Option<String> {
|
|
let output = Command::new("git")
|
|
.args(["rev-parse", "HEAD"])
|
|
.output()
|
|
.ok()?;
|
|
|
|
if !output.status.success() {
|
|
return None;
|
|
}
|
|
|
|
let hash = String::from_utf8(output.stdout).ok()?;
|
|
let hash = hash.trim().to_string();
|
|
|
|
if hash.is_empty() {
|
|
None
|
|
} else {
|
|
Some(hash)
|
|
}
|
|
}
|