Yokan / rebuild
Course 1 8624561

README.md

README.md

documentation / design asset166 lines
1# Yokan23Yokan is a Kotlin Multiplatform media library for manga, anime, and novels. The shared Compose Multiplatform app targets Android, desktop JVM, iOS, and WebAssembly browsers.45Yokan includes no extensions or preconfigured catalogs. Add repositories or6catalogs yourself, or restore them and your extensions from a backup.78## Features910- Manga, anime, and novel libraries with categories, history, updates, downloads, and tracking11- Source and extension catalogs with QuickJS, LNReader, and Mihon-compatible runtimes12- Configurable manga, novel, and anime reader/player experiences13- Room-backed local persistence with repository-provided source metadata and schema migrations14- Backup and restore, cloud sync, metadata lookup, recommendations, and watch order15- Periodic metadata refresh, library updates, and sync with result notifications via WorkManager on Android, BGTaskScheduler on iOS, and an in-app fallback on desktop/web16- Adaptive Material 3 navigation for compact and wide layouts17- Light, dark, dynamic-color, and custom palette themes1819## Requirements2021- JDK 2122- Android SDK for Android builds23- Xcode for iOS builds2425Gradle selects an installed JDK 21 using `gradle/gradle-daemon-jvm.properties`,26even when your shell defaults to a newer Java version. Set `JAVA_HOME` to JDK 2127as well to use it for the Gradle launcher. If your JDK is outside Gradle's28auto-detected locations, add its path to `org.gradle.java.installations.paths`29in your user-level `~/.gradle/gradle.properties`. The optional30`yokan.desktop.java.home` property selects the desktop app's runtime.31Set `ANDROID_HOME` or `ANDROID_SDK_ROOT` to the Android SDK location so each included build can resolve it.3233## Getting started3435```bash36git clone --recurse-submodules https://git.friedcutlet.com/friedcutlet/yokan.git37cd yokan38```3940For an existing clone, initialize the pinned repositories with `git submodule update --init --recursive`. The media-kit dependency does not need a separate checkout.4142## Build and run4344```bash45# Desktop46./gradlew :composeApp:run4748# Web development server49./gradlew :composeApp:wasmJsBrowserDevelopmentRun5051# Production web bundle52./gradlew :composeApp:wasmJsBrowserDistribution5354# Android debug APK55./gradlew :androidApp:assembleDebug5657# Shared and desktop tests58./gradlew :composeApp:desktopTest5960# iOS simulator framework61./gradlew :composeApp:linkDebugFrameworkIosSimulatorArm6462```6364Open `iosApp/iosApp.xcodeproj` to run the iOS host application.6566Forgejo CI (`.forgejo/workflows/ci.yml`) runs on pushes to `main` and on pull67requests: desktop tests and Android unit tests, plus Android and Kotlin/Wasm68compilation. Kotlin/Wasm browser tests and iOS simulator tests are not in CI yet:69`wasmJsBrowserTest` fails in Karma (`import.meta` outside a module) and70`IosLocalMediaInputTest` fails on the simulator; both predate this setup.7172For TestFlight, the **iOS TestFlight** Codemagic workflow builds a signed Release73IPA on macOS and distributes it to the **Yokan Testers** group on pushes to74`main` or a manual run. Complete the one-time signing and App Store Connect setup75in [iosApp/README.md](iosApp/README.md#testflight-with-codemagic) before running it.7677## Versions and release channels7879The version number determines the release channel:8081| Version range | Channel | Example |82| --- | --- | --- |83| `0.0.x` | Alpha | `v0.0.1` |84| `0.x.x`, with minor greater than zero | Beta | `v0.1.0` |85| Major version one or higher | Stable | `v1.0.0` |8687`version.xcconfig` defines the local version (currently `0.1.0`, beta) for88Gradle and Xcode. Update `CURRENT_PROJECT_VERSION` there when changing the local89version; the default build-number formula is `major * 1000000 + minor * 1000 + patch`90(with a minimum of one). Android and desktop installers, the shared app's About91screen, and iOS sideload packages use the same version. Release workflows override92the local value with their tag and mark alpha/beta releases as previews.9394```bash95# Resolve the version/channel without compiling the app96./gradlew :composeApp:printYokanVersion -Pyokan.version=1.0.09798# Build a particular channel/version99./gradlew :androidApp:assembleRelease -Pyokan.version=0.0.1100YOKAN_VERSION=v0.1.0 scripts/build-ios-unsigned-ipa.sh101```102103`YOKAN_VERSION` works for all Gradle builds too; `-Pyokan.version` takes precedence.104An optional `-Pyokan.versionCode` / `YOKAN_VERSION_CODE` overrides the derived105Android/iOS build number. Tags must be `vMAJOR.MINOR.PATCH` with no suffix.106The in-app updater includes alpha and beta releases for preview builds: beta107accepts beta/stable updates, alpha accepts all channels, and stable accepts only108stable releases. It chooses the highest eligible version among the 100 most recent109published GitHub releases, skipping drafts.110111Update checks and the About screen use112[Schnitzel5/yokan releases](https://github.com/Schnitzel5/yokan/releases).113Checks use the public GitHub API without credentials. A private releases repository114cannot serve updates to ordinary app installations; the releases repository must be115public for these checks to work.116117## Manual GitHub releases118119In GitHub Actions, select **Manual Release → Run workflow** on `main`, enter an120existing Forgejo `vMAJOR.MINOR.PATCH` tag, and select platforms. All platforms are enabled121by default. GitHub hosts the release assets; app source is cloned from Forgejo using122the `FORGEJO_USERNAME` and `FORGEJO_TOKEN` repository secrets. The workflow validates123the Forgejo tag and builds its resolved commit, using124the workflow's automation rather than whichever workflow exists in that old tag.125Tags predating version overrides may retain their original embedded app version.126127Existing assets are skipped unless **Rebuild and replace** is enabled. New releases128start as drafts and are published only after every selected build succeeds. Alpha129and beta tags are marked as prereleases. Resuming a failed run with a new manual130request builds only missing assets; successful assets are preserved.131132Builds upload directly to GitHub Releases, without storing copies as Actions133artifacts. Gradle caching avoids repeated dependency downloads and cleans unused134cache entries; it uses the separate Actions cache allowance. The IPA and iOS135framework share one compilation, with the IPA explicitly including the Zero136interpreter and extension server. Jobs have time limits, and a new release request137cancels the previous one. Building all platforms, especially macOS/iOS in a private138repository, still consumes Actions minutes; deselect platforms when unnecessary.139140The macOS packager requires a positive major version. Its internal package version141uses `major + 1` (`0.0.1` → `1.0.1`, `0.1.0` → `1.1.0`, `1.0.0` → `2.0.0`)142to keep upgrades ordered across channels; release tags and the in-app version143retain the original number.144145The web target stores its database snapshot in browser `localStorage`. Native-only capabilities—QuickJS extensions, the local Mihon server, filesystem downloads, Room/SQLite, and libmpv—are unavailable; media playback uses the HTML5-backed Compose player.146147## Project layout148149- `composeApp/src/commonMain` — shared code under `eu.friedcutlet.yokan`: `app` (composition root: `YokanRuntime`, `ServiceRegistry`, bootstrap), `data` (repository, settings and library-index holders), `database` (+ `sync`), `domain`, `services/<domain>`, and `ui` (`navigation` with the typed `Route`/`Navigator`, `components`, `theme`, `image`, `status`, `screens/<feature>`)150- `composeApp/src/androidMain` — Android services and platform integrations151- `composeApp/src/desktopMain` — desktop services and packaging152- `composeApp/src/iosMain` — iOS services and framework integration153- `composeApp/src/wasmJsMain` — browser services, localStorage persistence, and the Compose viewport entry point154- `composeApp/src/nonWebMain` — Room (`database/room`), QuickJS, and libmpv implementations shared by native/JVM targets155- `composeApp/src/commonTest` — shared tests156- `iosApp` — SwiftUI iOS host157- `vendor/kmp-mpv` — pinned submodule providing Kotlin Multiplatform libmpv bindings158- `vendor/yokan-ext` — pinned submodule providing Yokan extensions159160Room schema snapshots live in `composeApp/schemas` and must be committed with migration changes.161162## Android release signing163164The release workflow signs and verifies the APK before upload. Configure the stable signing key on GitHub using repository secrets `ANDROID_KEYSTORE_BASE64` (base64-encoded keystore), `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`, and `ANDROID_KEY_PASSWORD`. Missing secrets fail the release; unsigned APKs are never published. Keep the keystore backed up outside this repository so future versions can update existing installations.165166Local `assembleRelease` builds remain unsigned. On Linux with Android build-tools 36.0.0 installed, set these environment variables and run `bash scripts/sign-android-apk.sh <unsigned.apk> <signed.apk>` to produce the same verified artifact.167

Search chapters, reference and source filenames.