euv_cli/builder/desktop/struct.rs
1use super::*;
2
3/// Configuration for building, verifying, staging, and archiving a desktop or terminal client.
4#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
5pub struct DesktopBuildConfig {
6 /// Workspace or project root directory.
7 pub(crate) repo_root: PathBuf,
8 /// Target desktop or terminal platform kind.
9 #[get(type(copy))]
10 pub(crate) target: DesktopTargetKind,
11 /// Optional explicit Cargo package name (defaults to `euv-example` or `euv-cli`).
12 pub(crate) package: Option<String>,
13 /// Optional explicit Rust target triple passed via `--target`.
14 pub(crate) target_triple: Option<String>,
15 /// Output staging directory (default `dist/client-<platform>`).
16 pub(crate) out_dir: PathBuf,
17 /// Optional archive destination path (`.tar.gz` or `.zip`).
18 pub(crate) archive_path: Option<PathBuf>,
19 /// Optional custom source PNG icon path override.
20 pub(crate) icon_path: Option<PathBuf>,
21 /// Optional explicit release version string override.
22 pub(crate) version: Option<String>,
23 /// Optional Cargo feature list passed via `--features`.
24 pub(crate) features: Vec<String>,
25 /// Whether to compile with `--release`.
26 #[get(type(copy))]
27 pub(crate) release: bool,
28 /// Whether to also compile and bundle `euv-cli` (`euv[.exe]`) alongside the app binary.
29 #[get(type(copy))]
30 pub(crate) include_cli: bool,
31 /// Whether to run post-build headless smoke verification (`--headless --software` and `euv doctor`).
32 #[get(type(copy))]
33 pub(crate) smoke: bool,
34 /// Whether to verify zero dev-only AI schema markers in release executables.
35 #[get(type(copy))]
36 pub(crate) verify_ai_schema: bool,
37}
38
39/// Structured summary returned by `build_desktop_client`.
40#[derive(Clone, Data, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
41pub struct DesktopBuildReport {
42 /// Target platform label (`macos`, `windows`, `linux`, `tui`, or `cli`).
43 pub(crate) platform: String,
44 /// Primary built Cargo package name.
45 pub(crate) package: String,
46 /// Resolved workspace semantic version.
47 pub(crate) version: String,
48 /// Staging directory containing binaries and native platform icon.
49 pub(crate) out_dir: PathBuf,
50 /// Every file staged inside `out_dir`.
51 pub(crate) staged_files: Vec<PathBuf>,
52 /// Path to generated platform icon (`euv.icns`, `euv.ico`, or `euv.png`), if applicable.
53 pub(crate) icon_path: Option<PathBuf>,
54 /// Path to written archive file, if requested.
55 pub(crate) archive_path: Option<PathBuf>,
56 /// Whether post-build smoke tests executed and succeeded.
57 #[get(type(copy))]
58 pub(crate) smoke_passed: bool,
59 /// Whether release AI-schema scan verified zero dev markers.
60 #[get(type(copy))]
61 pub(crate) ai_schema_clean: bool,
62 /// End-to-end wall-clock build and packaging duration in milliseconds.
63 #[get(type(copy))]
64 pub(crate) elapsed_ms: u64,
65}
66
67/// Internal package resolution metadata derived from `cargo metadata --no-deps`.
68pub(crate) struct DesktopPackageMeta {
69 /// Resolved primary Cargo package name.
70 pub(crate) package_name: String,
71 /// Resolved primary executable binary stem.
72 pub(crate) bin_name: String,
73 /// Resolved semantic version from `Cargo.toml`.
74 pub(crate) version: String,
75 /// Cargo target directory path.
76 pub(crate) target_dir: PathBuf,
77 /// Whether `euv-cli` exists in the workspace for `--include-cli`.
78 pub(crate) has_cli_member: bool,
79}