2026-06-16 10:15:15 -04:00
|
|
|
// Shared schema, included from the same source the runtime command parses with,
|
|
|
|
|
// so the build-time validation below and the runtime parse cannot drift.
|
|
|
|
|
include!("src/commands/reconnect_hook_config.rs");
|
|
|
|
|
|
2026-03-09 13:02:11 -07:00
|
|
|
fn main() {
|
2026-06-11 01:06:29 -07:00
|
|
|
println!("cargo:rerun-if-env-changed=BUZZ_RELAY_URL");
|
|
|
|
|
println!("cargo:rerun-if-env-changed=BUZZ_RELAY_HTTP");
|
2026-06-11 08:06:24 -07:00
|
|
|
println!("cargo:rerun-if-env-changed=BUZZ_UPDATER_PUBLIC_KEY");
|
|
|
|
|
println!("cargo:rerun-if-env-changed=BUZZ_UPDATER_ENDPOINT");
|
|
|
|
|
println!("cargo:rerun-if-env-changed=BUZZ_BUILD_DATABRICKS_HOST");
|
|
|
|
|
println!("cargo:rerun-if-env-changed=BUZZ_BUILD_DATABRICKS_MODEL");
|
2026-06-16 10:15:15 -04:00
|
|
|
println!("cargo:rerun-if-env-changed=BUZZ_BUILD_RELAY_RECONNECT_CMD");
|
2026-06-11 08:06:24 -07:00
|
|
|
println!("cargo:rustc-check-cfg=cfg(buzz_updater_enabled)");
|
2026-03-25 15:43:20 -07:00
|
|
|
|
2026-06-11 01:06:29 -07:00
|
|
|
if let Ok(relay_url) = std::env::var("BUZZ_RELAY_URL") {
|
|
|
|
|
println!("cargo:rustc-env=BUZZ_DESKTOP_BUILD_RELAY_URL={relay_url}");
|
2026-03-25 15:43:20 -07:00
|
|
|
}
|
|
|
|
|
|
2026-06-11 01:06:29 -07:00
|
|
|
if let Ok(relay_http) = std::env::var("BUZZ_RELAY_HTTP") {
|
|
|
|
|
println!("cargo:rustc-env=BUZZ_DESKTOP_BUILD_RELAY_HTTP={relay_http}");
|
2026-03-25 15:43:20 -07:00
|
|
|
}
|
|
|
|
|
|
2026-06-11 08:06:24 -07:00
|
|
|
if let Ok(host) = std::env::var("BUZZ_BUILD_DATABRICKS_HOST") {
|
|
|
|
|
println!("cargo:rustc-env=BUZZ_DESKTOP_BUILD_DATABRICKS_HOST={host}");
|
2026-06-08 09:17:30 -07:00
|
|
|
}
|
|
|
|
|
|
2026-06-11 08:06:24 -07:00
|
|
|
if let Ok(model) = std::env::var("BUZZ_BUILD_DATABRICKS_MODEL") {
|
|
|
|
|
println!("cargo:rustc-env=BUZZ_DESKTOP_BUILD_DATABRICKS_MODEL={model}");
|
2026-06-08 09:17:30 -07:00
|
|
|
}
|
|
|
|
|
|
2026-06-16 10:15:15 -04:00
|
|
|
if let Ok(val) = std::env::var("BUZZ_BUILD_RELAY_RECONNECT_CMD") {
|
|
|
|
|
let parsed: serde_json::Value = serde_json::from_str(&val)
|
|
|
|
|
.unwrap_or_else(|e| panic!("BUZZ_BUILD_RELAY_RECONNECT_CMD is not valid JSON: {e}"));
|
|
|
|
|
serde_json::from_value::<ReconnectHookConfig>(parsed).unwrap_or_else(|e| {
|
|
|
|
|
panic!("BUZZ_BUILD_RELAY_RECONNECT_CMD doesn't match ReconnectHookConfig: {e}")
|
|
|
|
|
});
|
|
|
|
|
println!("cargo:rustc-env=BUZZ_DESKTOP_BUILD_RELAY_RECONNECT_CMD={val}");
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-11 08:06:24 -07:00
|
|
|
let updater_public_key = std::env::var("BUZZ_UPDATER_PUBLIC_KEY")
|
2026-04-23 12:55:35 -06:00
|
|
|
.ok()
|
|
|
|
|
.map(|value| value.trim().to_string())
|
|
|
|
|
.filter(|value| !value.is_empty());
|
2026-06-11 08:06:24 -07:00
|
|
|
let updater_endpoint = std::env::var("BUZZ_UPDATER_ENDPOINT")
|
2026-04-23 12:55:35 -06:00
|
|
|
.ok()
|
|
|
|
|
.map(|value| value.trim().to_string())
|
|
|
|
|
.filter(|value| !value.is_empty());
|
|
|
|
|
|
|
|
|
|
if updater_public_key.is_some() && updater_endpoint.is_some() {
|
2026-06-11 08:06:24 -07:00
|
|
|
println!("cargo:rustc-cfg=buzz_updater_enabled");
|
2026-04-23 12:55:35 -06:00
|
|
|
}
|
|
|
|
|
|
2026-03-09 13:02:11 -07:00
|
|
|
tauri_build::build()
|
|
|
|
|
}
|