tauri-app: add icons, package with record-daemon, change name
All checks were successful
record-daemon / Build, check and test (push) Successful in 2m9s
3
tauri-app/src-tauri/.gitignore
vendored
@@ -5,3 +5,6 @@
|
||||
# Generated by Tauri
|
||||
# will have schema files for capabilities auto-completion
|
||||
/gen/schemas
|
||||
|
||||
# Bundled record-daemon binaries (built by build.rs)
|
||||
/binaries/
|
||||
|
||||
32
tauri-app/src-tauri/Cargo.lock
generated
@@ -1960,6 +1960,22 @@ dependencies = [
|
||||
"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]]
|
||||
name = "leb128fmt"
|
||||
version = "0.1.0"
|
||||
@@ -3797,22 +3813,6 @@ dependencies = [
|
||||
"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]]
|
||||
name = "tauri-build"
|
||||
version = "2.5.6"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "tauri-app"
|
||||
name = "leaguerecorder"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
|
||||
@@ -1,3 +1,98 @@
|
||||
fn main() {
|
||||
build_record_daemon();
|
||||
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()
|
||||
);
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 228 KiB |
BIN
tauri-app/src-tauri/icons/icon_full.png
Normal file
|
After Width: | Height: | Size: 797 KiB |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "tauri-app",
|
||||
"productName": "leaguerecorder",
|
||||
"version": "0.1.0",
|
||||
"identifier": "v.leaguerecorder",
|
||||
"build": {
|
||||
@@ -40,6 +40,7 @@
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
],
|
||||
"externalBin": ["binaries/record-daemon"]
|
||||
}
|
||||
}
|
||||
|
||||