mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-08-05 19:59:51 +00:00
4.8 KiB
4.8 KiB
AGENTS
Repo shape (KMP + modules)
- Gradle multi-module:
:composeApp(main app),:plugin_interfaces(plugin API contracts),:js_plugin_example(Zipline JS plugin template). :composeAppuses custom KMP source sets (mobileMain,androidJvmMain) with explicitdependsOn; Gradle prints "Default Kotlin Hierarchy Template Not Applied Correctly" warning. Treat as known/expected.
Real app entrypoints
- Desktop/JVM:
composeApp/src/jvmMain/kotlin/dev/krtirtho/spotube/main.kt(mainClass = dev.krtirtho.spotube.MainKt). - Android:
composeApp/src/androidMain/kotlin/dev/krtirtho/spotube/MainActivity.kt. - iOS bridge:
composeApp/src/iosMain/kotlin/dev/krtirtho/spotube/MainViewController.ktandiosApp/iosApp/ContentView.swift.
High-value commands
- Use Gradle wrapper (
./gradlewor./gradlew.bat) only. - Run desktop:
:composeApp:run - Build Android debug:
:composeApp:assembleDebug - Module checks:
:composeApp:check,:plugin_interfaces:check,:js_plugin_example:check - Focused tests:
:composeApp:jvmTest,:composeApp:iosSimulatorArm64Test,:plugin_interfaces:jvmTest,:plugin_interfaces:jsTest,:js_plugin_example:jsTest - No lint/typecheck/formatter tasks are configured;
:composeApp:checkis the only aggregated check.
Dependencies
gradle/libs.versions.tomlis the single source of truth for all version pins and library declarations.- Kotlin:
2.3.0, JVM target:11(compile/target compatibility in bothcomposeApp/build.gradle.ktsandplugin_interfaces/build.gradle.kts).
Codegen and plugin packaging
- JS plugin bundles:
:js_plugin_example:packageDevelopmentPluginand:js_plugin_example:packageProductionPlugin. Output is.smplugfiles injs_plugin_example/build/distributions/. - Zipline plugin entrypoint:
mainFunction = "dev.krtirtho.js_plugin_example.main"injs_plugin_example/build.gradle.kts. Plugin metadata fromjs_plugin_example/plugin.json.
Plugin architecture
plugin_interfacesexportszipline.coreandsemveras API.composeAppdepends on it for the plugin system.plugin_interfacesalso has a JS target (browser()), used by the plugin system.
UI component patterns
- AdaptiveDropdownBottomSheet (
commonMain/.../core/ui/component/AdaptiveDropdownBottomSheet.kt): switches betweenDropdownMenu(large screen) andModalBottomSheet(small screen) viacurrentWindowAdaptiveInfo(). Do NOT use expect/actual — all adaptive components that rely ONLY on Compose/Material3 APIs belong in commonMain. - AdaptiveDialogBottomSheet (
commonMain/.../core/ui/component/AdaptiveDialogBottomSheet.kt): switches betweenThemedDialog(large screen) andModalBottomSheet(small screen) viacurrentWindowAdaptiveInfo(). Same rule — keep in commonMain unless platform-specific APIs are required. - Use
expect/actualonly when the component MUST use platform-specific APIs (e.g.WindowStatefor desktop window controls, native scrollbars). Pure Compose/Material3 adaptivity stays in commonMain. - JavaFX is required;
--add-opensflags incompose.desktop.application.jvmArgsmust be preserved:javafx.graphics/javafx.scene,javafx.graphics/com.sun.javafx.sg.prism,javafx.graphics/com.sun.javafx.scene,javafx.web/com.sun.webkit,javafx.media/com.sun.media.jfxmedia,javafx.media/com.sun.media.jfxmedia.events. - JavaFX dependencies are loaded from OpenJFX with platform classifiers (win/mac/linux) resolved at configuration time via
System.getProperty("os.name").
Tooling
- Gradle config cache enabled (
gradle.properties); prefer module-scoped tasks. - Gradle daemon JVM pinned to JetBrains JDK 21 via
gradle/gradle-daemon-jvm.properties. - Gradle 8.14.3 (from
gradle/wrapper/gradle-wrapper.properties). - Foojay toolchain resolver in use (
plugins { id("org.gradle.toolchains.foojay-resolver-convention") }).
Current testing reality
- No committed
*Test*.ktfiles; test tasks may run zero tests unless new tests are added.
Release workflow (.github/workflows/release.yml)
- Triggered by
workflow_dispatchwith arelease_typechoice input (stable|nightly). prepare-depsjob checks out & publishes tomavenLocal:kdroidFilter/ComposeNativeWebview(compose-webview)team-spotube/gradle-plugin(spotubeGradle + vlcjBundler plugins)
- Build jobs per platform (Android, Linux, Windows, macOS), all
needs: prepare-deps. - Stable: reads
versionNamefromcomposeApp/build.gradle.kts, tag =v{version}, draft release. - Nightly: builds with
-PversionName=nightly, tag =nightly(updates existing), prerelease. - Android signing: decodes
secrets.KEYSTORE(base64) →composeApp/upload-keystore.jks, writes signing config intolocal.propertiesfrom secrets. create-releasejob (depends on all builds) usessoftprops/action-gh-release@v2to create the GitHub release with all artifacts attached.