tauri-app: add icons, package with record-daemon, change name
All checks were successful
record-daemon / Build, check and test (push) Successful in 2m9s

This commit is contained in:
2026-05-17 19:24:36 +02:00
parent af6494e774
commit 2e7be439b0
11 changed files with 118 additions and 19 deletions

View File

@@ -5,3 +5,6 @@
# Generated by Tauri # Generated by Tauri
# will have schema files for capabilities auto-completion # will have schema files for capabilities auto-completion
/gen/schemas /gen/schemas
# Bundled record-daemon binaries (built by build.rs)
/binaries/

View File

@@ -1960,6 +1960,22 @@ dependencies = [
"selectors 0.24.0", "selectors 0.24.0",
] ]
[[package]]
name = "leaguerecorder"
version = "0.1.0"
dependencies = [
"chrono",
"directories",
"ffmpeg-sidecar",
"serde",
"serde_json",
"tauri",
"tauri-build",
"tauri-plugin-opener",
"tokio",
"uuid",
]
[[package]] [[package]]
name = "leb128fmt" name = "leb128fmt"
version = "0.1.0" version = "0.1.0"
@@ -3797,22 +3813,6 @@ dependencies = [
"windows", "windows",
] ]
[[package]]
name = "tauri-app"
version = "0.1.0"
dependencies = [
"chrono",
"directories",
"ffmpeg-sidecar",
"serde",
"serde_json",
"tauri",
"tauri-build",
"tauri-plugin-opener",
"tokio",
"uuid",
]
[[package]] [[package]]
name = "tauri-build" name = "tauri-build"
version = "2.5.6" version = "2.5.6"

View File

@@ -1,5 +1,5 @@
[package] [package]
name = "tauri-app" name = "leaguerecorder"
version = "0.1.0" version = "0.1.0"
description = "A Tauri App" description = "A Tauri App"
authors = ["you"] authors = ["you"]

View File

@@ -1,3 +1,98 @@
fn main() { fn main() {
build_record_daemon();
tauri_build::build() tauri_build::build()
} }
/// Build the record-daemon in release mode and place it in the binaries/
/// directory with the target-triple suffix that Tauri's `externalBin` feature
/// expects.
///
/// The resulting binary is copied to:
/// src-tauri/binaries/record-daemon-<target-triple>[.exe]
///
/// This runs as part of `cargo build`, so the daemon is always available when
/// the Tauri bundler needs it. Because record-daemon lives in a separate
/// Cargo workspace, invoking `cargo build` from here does not conflict with
/// the parent build's lock.
fn build_record_daemon() {
use std::env;
use std::fs;
use std::path::PathBuf;
use std::process::Command;
let target = env::var("TARGET").unwrap();
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
// Resolve the record-daemon crate root (../../record-daemon/ from src-tauri/)
let daemon_dir = manifest_dir
.parent()
.expect("CARGO_MANIFEST_DIR has no parent")
.parent()
.expect("parent of CARGO_MANIFEST_DIR has no parent")
.join("record-daemon");
let daemon_manifest = daemon_dir.join("Cargo.toml");
if !daemon_manifest.exists() {
eprintln!(
"cargo:warning=record-daemon not found at {}, skipping daemon build",
daemon_manifest.display()
);
return;
}
// Build the daemon in release mode for the same target triple.
// Passing --target ensures the output lands in a predictable directory
// and supports cross-compilation.
let status = Command::new("cargo")
.args([
"build",
"--release",
"--manifest-path",
])
.arg(&daemon_manifest)
.arg("--target")
.arg(&target)
.status()
.expect("Failed to execute cargo build for record-daemon");
if !status.success() {
panic!("Failed to build record-daemon in release mode");
}
// Locate the built binary.
// When --target is specified, cargo places output in target/<triple>/release/.
let src_name = if target.contains("windows") {
"record-daemon.exe"
} else {
"record-daemon"
};
let src_binary = daemon_dir
.join("target")
.join(&target)
.join("release")
.join(src_name);
if !src_binary.exists() {
panic!(
"record-daemon binary not found at {} after successful build",
src_binary.display()
);
}
// Copy to src-tauri/binaries/record-daemon-<target-triple>[.exe]
let binaries_dir = manifest_dir.join("binaries");
fs::create_dir_all(&binaries_dir).expect("Failed to create binaries directory");
let dst_name = if target.contains("windows") {
format!("record-daemon-{}.exe", target)
} else {
format!("record-daemon-{}", target)
};
let dst_binary = binaries_dir.join(&dst_name);
fs::copy(&src_binary, &dst_binary).expect("Failed to copy record-daemon binary");
println!(
"cargo:warning=Bundled record-daemon → {}",
dst_binary.display()
);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 KiB

View File

@@ -1,6 +1,6 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "tauri-app", "productName": "leaguerecorder",
"version": "0.1.0", "version": "0.1.0",
"identifier": "v.leaguerecorder", "identifier": "v.leaguerecorder",
"build": { "build": {
@@ -40,6 +40,7 @@
"icons/128x128@2x.png", "icons/128x128@2x.png",
"icons/icon.icns", "icons/icon.icns",
"icons/icon.ico" "icons/icon.ico"
] ],
"externalBin": ["binaries/record-daemon"]
} }
} }