Release 0.4.4

This commit is contained in:
galister
2024-08-11 06:15:43 +09:00
parent 378ea120c8
commit d9287f3250
4 changed files with 29 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -4574,7 +4574,7 @@ dependencies = [
[[package]]
name = "wlx-overlay-s"
version = "0.4.3"
version = "0.4.4"
dependencies = [
"anyhow",
"ash",

View File

@@ -4,7 +4,7 @@ debug = true
[package]
name = "wlx-overlay-s"
version = "0.4.3"
version = "0.4.4"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -70,6 +70,9 @@ image_dds = { version = "0.6.0", default-features = false, features = [
] }
mint = "0.5.9"
[build-dependencies]
regex = { version = "*" }
[features]
default = ["openvr", "openxr", "osc", "x11", "wayland"]
openvr = ["dep:ovr_overlay", "dep:json"]

23
build.rs Normal file
View File

@@ -0,0 +1,23 @@
use regex::Regex;
use std::process::Command;
fn main() {
let mut wlx_build = get_version().unwrap_or(format!("{} (Cargo)", env!("CARGO_PKG_VERSION")));
if std::env::var("GITHUB_ACTIONS").is_ok() {
wlx_build = format!("{} (AppImage)", &wlx_build)
}
println!("cargo:rustc-env=WLX_BUILD={}", &wlx_build);
}
fn get_version() -> Result<String, Box<dyn std::error::Error>> {
let re = Regex::new(r"v([0-9.]+)-([0-9]+)-g([a-f0-9]+)").unwrap(); // safe
let output = Command::new("git")
.args(["describe", "--tags", "--abbrev=7"])
.output()?;
let output_str = String::from_utf8(output.stdout)?;
Ok(re.replace_all(&output_str, "${1}.r${2}.${3}").into_owned())
}

View File

@@ -79,7 +79,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
log::info!(
"Welcome to {} version {}!",
env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION")
env!("WLX_BUILD"),
);
log::info!("It is {}.", chrono::Local::now().format("%c"));