Products seed: 9299 products bundled in products_seed.db, Kotlin copies from assets to filesDir on Android, Rust imports into main DB on first launch with version check for future updates. Settings: profile button, offline toggle, GPS permission, app info with git hash and build date from build.rs. Build: version synced to Cargo.toml, unified import (GPX/FTB by extension), chart zoom Ctrl+scroll only, scroll wheel zoom disabled on detail map.
25 lines
739 B
Rust
25 lines
739 B
Rust
use std::process::Command;
|
|
|
|
fn main() {
|
|
// Pass git hash and build info to Rust via env vars
|
|
let git_hash = Command::new("git")
|
|
.args(["rev-parse", "--short", "HEAD"])
|
|
.output()
|
|
.map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string())
|
|
.unwrap_or_else(|_| "unknown".into());
|
|
|
|
let build_date = chrono_free_date();
|
|
|
|
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
|
println!("cargo:rustc-env=BUILD_DATE={}", build_date);
|
|
|
|
tauri_build::build()
|
|
}
|
|
|
|
fn chrono_free_date() -> String {
|
|
Command::new("date")
|
|
.args(["+%Y-%m-%d %H:%M"])
|
|
.output()
|
|
.map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string())
|
|
.unwrap_or_else(|_| "unknown".into())
|
|
}
|