-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
30 lines (24 loc) · 1.09 KB
/
build.rs
File metadata and controls
30 lines (24 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::env;
use std::process::Command;
fn main() {
let profile = env::var("PROFILE").unwrap_or_else(|_| "debug".to_string());
// Skip automations if we are building a package (e.g., Arch PKGBUILD)
// Arch's makepkg sets SOURCE_DATE_EPOCH.
let is_packaging = env::var("SOURCE_DATE_EPOCH").is_ok();
if profile == "release" && !is_packaging {
// Only run formatting and asset syncing during local development release builds
let _ = Command::new("cargo").args(["fmt"]).status();
println!("cargo:warning=>>> Release build detected. Syncing assets via Makefile...");
let status = Command::new("make").arg("install").status();
if let Ok(s) = status {
if s.success() {
println!("cargo:warning=>>> Assets synced successfully.");
} else {
println!("cargo:warning=>>> Makefile failed with status: {}", s);
}
}
}
println!("cargo:rerun-if-changed=Makefile");
println!("cargo:rerun-if-changed=scripts/properties.py");
println!("cargo:rerun-if-changed=flux.desktop");
}