[package]
name = "gitty"
version = "0.1.0"
description = "Rust backend for a lightweight Git desktop client"
edition = "2024"
rust-version = "1.88"
build = "build.rs"

[workspace]
members = [".", "crates/commit_ai"]

[workspace.package]
edition = "2024"

[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri = { version = "2", features = [] }
tauri-plugin-dialog = "=2.7.0"
tauri-plugin-aptabase = "1.0"
keyring = { version = "3", features = ["apple-native", "windows-native", "async-secret-service", "crypto-rust", "async-io"] }
commit_ai = { path = "crates/commit_ai" }
tokio = "1.52.3"
log = "0.4"
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
sysinfo = { version = "=0.38.3", default-features = false, features = ["system"] }

[build-dependencies]
tauri-build = { version = "2", features = [] }

[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-single-instance = "2"

# Self-updating only makes sense for install methods this app ships itself
# (NSIS on Windows, the .app bundle on macOS). On Linux the app is meant to be
# installed via the system package manager (e.g. the PKGBUILD), which owns
# updates instead — so the updater plugin isn't even compiled in there.
[target.'cfg(not(any(target_os = "android", target_os = "ios", target_os = "linux")))'.dependencies]
tauri-plugin-updater = "2"

# ── Build profiles ───────────────────────────────────────────────────────────
# Dev: keep incremental compilation and emit only line-table debug info instead
# of full debuginfo. This cuts link time noticeably (linking is the slow part of
# a `tauri dev` recompile) while still giving panic backtraces with line numbers.
[profile.dev]
incremental = true
debug = "line-tables-only"

# Optimize third-party dependencies once (they are cached), so the running dev
# build is snappy without slowing down rebuilds of our own crate.
[profile.dev.package."*"]
opt-level = 2

# Release: smaller binary (also shrinks the auto-updater download) without
# regressing runtime performance of the code-search feature.
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1
strip = true
