Skip to content

Conversation

@jvsena42
Copy link
Owner

…nux)

Major Changes

Module Restructuring

  • Renamed app/androidApp/
  • Created shared/ multiplatform module
    • commonMain: Shared business logic and data models
    • androidMain: Android-specific implementations
    • desktopMain: Desktop-specific implementations (Windows/Linux)
  • Created desktopApp/ module for desktop builds

Dependencies Migration

  • Replaced Gson with kotlinx.serialization for multiplatform compatibility
  • Replaced OkHttp with Ktor Client (OkHttp engine for Android, CIO for desktop)
  • Added multiplatform-settings for cross-platform preferences
  • Updated to Compose Multiplatform 1.7.1

Platform Abstractions (expect/actual)

Created platform-specific implementations for:

  • PreferencesDataSource (SharedPreferences on Android, java.util.prefs on Desktop)
  • PlatformContext (data directories, logging)
  • FlorestaDaemon (daemon lifecycle management)

Code Migration to shared/commonMain

  • Domain models with @serializable annotations
  • RPC interfaces and Ktor-based implementation
  • Preference keys and data source interfaces
  • Basic shared App() composable

Platform Implementations

androidMain:

  • AndroidPreferencesDataSource using SharedPreferences
  • AndroidFlorestaDaemon wrapping UniFFI bindings
  • Android context initialization

desktopMain:

  • DesktopPreferencesDataSource using java.util.prefs.Preferences
  • DesktopFlorestaDaemon with background coroutine scope
  • Platform-specific data directories (Windows: %APPDATA%, Linux: ~/.local/share)

Application Entry Points

  • Android: Simplified MainActivity using shared App()
  • Desktop: Main.kt with Compose Desktop Window()
  • Desktop packaging configured for .msi (Windows), .deb/.rpm (Linux)

Build Commands

# Desktop
./gradlew :desktopApp:run
./gradlew :desktopApp:packageMsi  # Windows
./gradlew :desktopApp:packageDeb  # Linux

# Android
./gradlew :androidApp:assembleDebug

Remaining Work

  • Migrate ViewModels and UI screens to commonMain
  • Setup multiplatform navigation
  • Compile Rust libraries for x86_64 desktop
  • Test end-to-end on both platforms
  • Add desktop-specific features (system tray, menu bar)

See CMP_MIGRATION.md for complete migration details.

…nux)

## Major Changes

### Module Restructuring
- Renamed `app/` → `androidApp/`
- Created `shared/` multiplatform module
  - commonMain: Shared business logic and data models
  - androidMain: Android-specific implementations
  - desktopMain: Desktop-specific implementations (Windows/Linux)
- Created `desktopApp/` module for desktop builds

### Dependencies Migration
- Replaced Gson with kotlinx.serialization for multiplatform compatibility
- Replaced OkHttp with Ktor Client (OkHttp engine for Android, CIO for desktop)
- Added multiplatform-settings for cross-platform preferences
- Updated to Compose Multiplatform 1.7.1

### Platform Abstractions (expect/actual)
Created platform-specific implementations for:
- PreferencesDataSource (SharedPreferences on Android, java.util.prefs on Desktop)
- PlatformContext (data directories, logging)
- FlorestaDaemon (daemon lifecycle management)

### Code Migration to shared/commonMain
- Domain models with @serializable annotations
- RPC interfaces and Ktor-based implementation
- Preference keys and data source interfaces
- Basic shared App() composable

### Platform Implementations
**androidMain:**
- AndroidPreferencesDataSource using SharedPreferences
- AndroidFlorestaDaemon wrapping UniFFI bindings
- Android context initialization

**desktopMain:**
- DesktopPreferencesDataSource using java.util.prefs.Preferences
- DesktopFlorestaDaemon with background coroutine scope
- Platform-specific data directories (Windows: %APPDATA%, Linux: ~/.local/share)

### Application Entry Points
- Android: Simplified MainActivity using shared App()
- Desktop: Main.kt with Compose Desktop Window()
- Desktop packaging configured for .msi (Windows), .deb/.rpm (Linux)

## Build Commands
```bash
# Desktop
./gradlew :desktopApp:run
./gradlew :desktopApp:packageMsi  # Windows
./gradlew :desktopApp:packageDeb  # Linux

# Android
./gradlew :androidApp:assembleDebug
```

## Remaining Work
- Migrate ViewModels and UI screens to commonMain
- Setup multiplatform navigation
- Compile Rust libraries for x86_64 desktop
- Test end-to-end on both platforms
- Add desktop-specific features (system tray, menu bar)

See CMP_MIGRATION.md for complete migration details.
@jvsena42 jvsena42 self-assigned this Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants