[package]
name = "blinc_app"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
documentation = "https://docs.rs/blinc_app"
rust-version.workspace = true
description = "Blinc application framework with clean layout and rendering API"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("fuchsia", "ohos"))', 'cfg(target_env, values("ohos"))'] }

[lib]
# rlib: Rust library for normal use
# staticlib: C static library for iOS/Android linking
crate-type = ["rlib", "staticlib"]

[dependencies]
blinc_core = { path = "../blinc_core", version = "0.4.0" }
blinc_layout = { path = "../blinc_layout", version = "0.4.0" }
blinc_gpu = { path = "../blinc_gpu", version = "0.4.0", default-features = false }
blinc_svg = { path = "../blinc_svg", version = "0.4.0" }
blinc_text = { path = "../blinc_text", version = "0.4.0" }
blinc_image = { path = "../blinc_image", version = "0.4.0" }
blinc_platform = { path = "../blinc_platform", version = "0.4.0" }
blinc_animation = { path = "../blinc_animation", version = "0.4.0" }
blinc_macros = { path = "../blinc_macros", version = "0.4.0" }
blinc_router = { path = "../blinc_router", version = "0.4.0" }
blinc_theme = { path = "../blinc_theme", version = "0.4.0" }

# GPU
wgpu.workspace = true

# Windowing (optional - used by windowed feature)
winit = { workspace = true, optional = true }
raw-window-handle = { workspace = true }

# Async
pollster.workspace = true

# Error handling
thiserror.workspace = true
anyhow.workspace = true

# Logging
tracing.workspace = true

# Data structures
lru = { workspace = true }

# Serialization (window state persistence)
serde = { version = "1", features = ["derive"] }
serde_json = "1"

# File dialogs (desktop only)
rfd = { version = "0.15", optional = true }

# System tray (desktop only)
tray-icon = { version = "0.22", optional = true }
muda = { version = "0.17", optional = true }

# Desktop notifications
notify-rust = { version = "4", optional = true }

# Global keyboard shortcuts
global-hotkey = { version = "0.7", optional = true }

# Desktop platform - exclude mobile/embedded targets
[target.'cfg(not(any(target_os = "android", target_os = "ios", target_os = "fuchsia")))'.dependencies]
blinc_platform_desktop = { path = "../../extensions/blinc_platform_desktop", version = "0.4.0", optional = true }

[target.'cfg(target_os = "android")'.dependencies]
blinc_platform_android = { path = "../../extensions/blinc_platform_android", version = "0.4.0", optional = true }
android-activity = { workspace = true, optional = true }
ndk = { workspace = true, optional = true }
jni = { workspace = true, optional = true }
android_logger = { version = "0.14", optional = true }
log = { version = "0.4", optional = true }
tracing-android = { version = "0.2", optional = true }
tracing-subscriber = { workspace = true, optional = true }

[target.'cfg(target_os = "ios")'.dependencies]
blinc_platform_ios = { path = "../../extensions/blinc_platform_ios", version = "0.4.0", optional = true }


# HarmonyOS uses "ohos" as target_os
# [target.'cfg(target_os = "ohos")'.dependencies]
# blinc_platform_harmony = { path = "../../extensions/blinc_platform_harmony", version = "0.4.0", optional = true }

[dev-dependencies]
image.workspace = true
tracing-subscriber.workspace = true
blinc_cn = { path = "../blinc_cn", version = "0.4.0" }
blinc_icons = { path = "../blinc_icons", version = "0.4.0" }
blinc_tabler_icons = { path = "../blinc_tabler_icons", version = "0.4.0" }
blinc_canvas_kit = { path = "../blinc_canvas_kit", version = "0.4.0" }

[features]
default = ["windowed"]
windowed = ["winit", "blinc_platform_desktop", "blinc_gpu/desktop", "rfd", "tray-icon", "muda", "notify-rust", "global-hotkey"]
android = ["blinc_platform_android", "android-activity", "ndk", "jni", "android_logger", "log", "tracing-android", "tracing-subscriber", "blinc_gpu/android"]
ios = ["blinc_platform_ios", "blinc_gpu/ios"]
harmony = ["blinc_gpu/harmony"]  # blinc_platform_harmony when target is available
fuchsia = []
