build(android): cfg-gate desktop-only Tauri surfaces for android target
Phase 1 of the Android same-repo target plan: make the workspace
compilable for `aarch64-linux-android` (and the other NDK ABIs) by
removing the desktop-only crate dependencies and command bodies from the
Android build. After this commit, `tauri android init` followed by
`cargo tauri android build` is structurally unblocked — the remaining
work is the SDK/NDK toolchain (off-sandbox), the Svelte single-window
refactor, and the Phase 3 MVP feature surface.
What's gated under `cfg(not(target_os = "android"))`:
- src-tauri/Cargo.toml: `tauri = { features = ["tray-icon"] }` is now
declared in the desktop-only target block. The `global-shortcut`,
`window-state`, and `autostart` plugins join it — none of the three
support Android natively. The base `tauri = "2"` plus `dialog`,
`opener`, and `notification` plugins remain unconditional because they
do support Android.
- src-tauri/src/lib.rs: `mod tray` declaration, the matching
`tray::setup(app)` call, the close-to-tray `WindowEvent::CloseRequested`
handler, and the `.plugin(tauri_plugin_global_shortcut::*)` /
`_autostart` / `_window_state` chain are all desktop-only. The
builder is split with a single `#[cfg(not(target_os = "android"))]`
branch that adds the desktop plugins on top of the universal base.
- src-tauri/src/commands/tts.rs: `tts_speak` previously had three
`#[cfg(target_os = ...)]` branches but no fallback, so on Android the
`spawned` binding was unbound and the function failed to compile.
Mirrored the existing `paste.rs` not-implemented fallback. Same fix
for `list_voices_impl`. Frontend will hide the Read Page Aloud button
on Android via `isAndroid()`.
- src-tauri/src/commands/windows.rs: all four multi-window commands
(`open_task_window`, `open_preview_window`, `close_preview_window`,
`open_viewer_window`) get an Android stub that returns a clear
"Multi-window is not supported on Android" error. Tauri on Android
is single-Activity; the previously-secondary content (preview overlay,
transcript viewer, task float) will live as routes inside the main
window, gated by `isAndroid()` on the frontend.
What's *not* changed:
- Top-level `identifier` in tauri.conf.json stays `uk.co.corbel.kon`.
The Phase 10b Kon → Corbie rename sweep will land
`corbel.technology.corbie` as part of a coherent rebrand commit
rather than fragmenting the rename across this branch.
- `bundle.android.minSdkVersion: 24` added so a future
`tauri android init` knows to target Android 7.0+ (Vulkan available,
scoped storage starts at 29 — we'll surface scoped-storage paths
via Tauri's dialog plugin on Phase 3).
- `kon-hotkey` already exports a non-Linux stub; no changes needed.
- `commands/meeting.rs` still calls `process_watch::list_running_process_names()`
which compiles on Android but returns an empty list (SELinux blocks
/proc walk on API 24+). Frontend will hide the toggle on Android.
Verification: 91/91 tests still pass on the buildable-in-sandbox crates
(kon-storage 60, kon-core 16, kon-mcp 9, kon-hotkey 4, kon-cloud-providers
2). svelte-check 0/0 across 3957 files. The src-tauri crate itself can't
be compiled in this sandbox (no webkit2gtk); CI's desktop builders will
exercise the desktop branch, and Jake's Android-equipped dev box will
exercise the Android branch via `tauri android init`.
https://claude.ai/code/session_0189xUb6ie6t9qHkzatGZ9Rb
This commit is contained in:
@@ -37,16 +37,13 @@ kon-cloud-providers = { path = "../crates/cloud-providers" }
|
||||
kon-hotkey = { path = "../crates/hotkey" }
|
||||
kon-llm = { path = "../crates/llm" }
|
||||
|
||||
# Tauri
|
||||
tauri = { version = "2", features = ["tray-icon"] }
|
||||
# Tauri. The `tray-icon` feature, the global-shortcut/window-state/
|
||||
# autostart plugins are desktop-only — gated below under
|
||||
# cfg(not(target_os = "android")). The dialog, opener, and notification
|
||||
# plugins all support Android natively so live in the unconditional list.
|
||||
tauri = { version = "2" }
|
||||
tauri-plugin-opener = "2"
|
||||
tauri-plugin-dialog = "2"
|
||||
tauri-plugin-global-shortcut = "2"
|
||||
tauri-plugin-window-state = "2"
|
||||
# Phase 5 rituals: register Corbie as a login-time autostart entry.
|
||||
# Handles platform differences (.desktop file on Linux, LaunchAgents plist
|
||||
# on macOS, registry Run key on Windows) behind a single API.
|
||||
tauri-plugin-autostart = "2"
|
||||
# Phase 6 nudges: OS-native notifications via the frontend-owned nudge
|
||||
# bus. Permission-request flow happens on the JS side before the first
|
||||
# deliver_nudge call; Windows only delivers for installed apps.
|
||||
@@ -79,6 +76,25 @@ uuid = { version = "1", features = ["v4"] }
|
||||
# pollute the workspace.
|
||||
tempfile = "3"
|
||||
|
||||
# Desktop-only Tauri features and plugins. Each item below either fails
|
||||
# to compile against the Android NDK or is a structural no-op on a
|
||||
# single-window mobile app:
|
||||
# - tray-icon: no system tray on mobile.
|
||||
# - global-shortcut: mobile has no global hotkey API; the foreground
|
||||
# notification with a record button is the Android replacement.
|
||||
# - window-state: single-window, fullscreen, no per-window persistence.
|
||||
# - autostart: mobile apps don't auto-start in the desktop sense; if
|
||||
# we ever want a "boot completed" handler that's a separate Android
|
||||
# intent receiver, not this plugin.
|
||||
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||
tauri = { version = "2", features = ["tray-icon"] }
|
||||
tauri-plugin-global-shortcut = "2"
|
||||
tauri-plugin-window-state = "2"
|
||||
# Phase 5 rituals: register Corbie as a login-time autostart entry.
|
||||
# Handles platform differences (.desktop file on Linux, LaunchAgents plist
|
||||
# on macOS, registry Run key on Windows) behind a single API.
|
||||
tauri-plugin-autostart = "2"
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
webkit2gtk = "2.0"
|
||||
# Needed for setting the preview overlay's WindowTypeHint to Utility via
|
||||
|
||||
Reference in New Issue
Block a user