prole/installer/deploy.py
chrisfu 8a6e8738db ProleStatus: app-window default, light splash restored, status bar controls; endpoint config via properties; build + docs
- Default to Application Window mode with full app menu; status bar overlay remains available
- Restore clickable startup Splash Tip (5s) with animated GIF and live counter; use light theme (Aqua)
- Status bar item: monospaced "P" icon; left click shows overlay (status mode) or main window (app mode)
- Overlay: add Maximize button (□) to toggle back to main window; keep click‑through elsewhere
- Global hotkey Cmd+Opt+Shift+P toggles modes; Prole menu item mirrors the same toggle and updates title dynamically
- Application menu (Prole): Show Status Bar / Show Main Window (contextual), Refresh Now, Quit
- Application Window layout: non‑scrolling, vertical 1‑line rows (svc, k3s aggregate, local) with top‑right timestamp; bottom‑left controls (⟳ Refresh, _ Minimize)
- Parameterize endpoints via `prole.properties` (bundled + user override). Replace legacy raspberry with retropie defaults
- ServiceChecker + UI read endpoints from Config loader; tooltips/labels reflect configured hosts/ports
- Build script: generate `Info.plist` with `LSUIElement=false`; bundle resources (`prole-type.gif`, `prole.properties`); ad‑hoc codesign. Universal build supported
- Documentation: rewrite README with technical build/run/config details and operational posture

Files:
- proleStatus/Sources/: AppDelegate.swift, OverlayWindow.swift, StatusView.swift, StatusItemController.swift,
  SplashTipWindowController.swift, MainWindowController.swift, AppStatusView.swift, ServiceChecker.swift, Config.swift
- proleStatus/build.sh
- proleStatus/prole.properties
- proleStatus/README.md

Notes:
- Build verified via `./build.sh build` (arm64). App starts in App Window mode with light theme; menu + hotkey + overlay toggle operate as intended
2025-12-01 21:08:30 -08:00

58 lines
2.0 KiB
Python

"""
Deploy/build helpers for the Prole installer (root-level package).
Encapsulates Xcode tools check and building the native Prole app.
"""
from __future__ import annotations
from pathlib import Path
import platform
import subprocess
from tkinter import messagebox
def check_xcode_tools() -> bool:
if platform.system() != "Darwin":
return False
try:
result = subprocess.run(["xcrun", "--find", "swiftc"], capture_output=True, text=True, timeout=10)
return result.returncode == 0
except Exception:
return False
def build_prole_app(project_root: Path) -> None:
if platform.system() != "Darwin":
raise Exception("Building the macOS app requires macOS.")
if not check_xcode_tools():
raise Exception("Xcode Command Line Tools not found. Please run: xcode-select --install")
# Use the top-level prole-app project directory
prole_app_dir = Path(project_root) / "prole-app"
build_script = prole_app_dir / "build.sh"
if not build_script.exists():
raise Exception(
f"Build script not found at {build_script}"
)
result = subprocess.run(["bash", str(build_script), "build"], cwd=prole_app_dir, capture_output=True, text=True)
if result.returncode != 0:
raise Exception(f"Prole build failed: {result.stderr or result.stdout}")
app_path = prole_app_dir / "dist" / "Prole.app"
if not app_path.exists():
raise Exception("Build completed but Prole.app was not found in dist/")
try:
msg = (
"Prole.app has been built successfully.\n\n"
f"Location: {app_path}\n\n"
"Would you like to copy it to /Applications?"
)
if messagebox.askyesno("Prole Built", msg):
dest = Path("/Applications") / "Prole.app"
subprocess.run(["cp", "-R", str(app_path), str(dest)], check=True)
messagebox.showinfo("Copied", f"Copied to {dest}")
except Exception as copy_err:
print(f"Copy to /Applications failed: {copy_err}")