Skip to content

Commit a54c828

Browse files
committed
feat: convert Zayit to Kotlin Multiplatform (JVM desktop + Android + iOS)
The whole project is now KMP. JVM desktop is unchanged; Android and iOS build with stub UIs, and everything platform-agnostic moved into commonMain. leaf libraries (icons, texteffects, navigation, pagination, htmlparser, logger) - add Android + iOS targets - logger: Sentry + timestamp behind expect/actual (JVM=Sentry, mobile=stub), kotlin.concurrent.Volatile, drop @JvmField - navigation: java.util.UUID -> kotlin.uuid.Uuid; nowEpochMillis via kotlin.time.Clock - htmlparser: jsoup -> ksoup 0.2.6 (parser runs on all platforms) SeforimApp - add Android (KMP library) + iOS targets; iOS framework + MainViewController entry - relocate JVM-only deps (Nucleus, network, releasefetcher, ktor-cio) commonMain -> jvmMain - move ~75 files of platform-agnostic code (onboarding/settings/search use-cases, state, AppSettings, core utils, theme enums) into commonMain - AccentColor split: enum in commonMain, Jewel/Nucleus color resolution in jvmMain - search engine via common SearchEngine interface (JVM=Lucene, mobile=StubSearchEngine) - stub App() for Android/iOS; Jewel/Nucleus/Lucene/AWT desktop UI stays in jvmMain androidApp - new thin com.android.application module (AGP 9 forbids it in the KMP module) that hosts the launchable APK and depends on :SeforimApp build - AGP 9.1.1 built-in Kotlin (no kotlin-android plugin), compileSdk 36, android.library plugin available to subprojects, SeforimLibrary submodule bump Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
1 parent 882a1d2 commit a54c828

109 files changed

Lines changed: 363 additions & 189 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SeforimApp/build.gradle.kts

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
alias(libs.plugins.multiplatform)
99
alias(libs.plugins.compose.compiler)
1010
alias(libs.plugins.compose)
11-
// alias(libs.plugins.android.application)
11+
alias(libs.plugins.android.library)
1212
alias(libs.plugins.hotReload)
1313
alias(libs.plugins.kotlinx.serialization)
1414
alias(libs.plugins.buildConfig)
@@ -35,12 +35,19 @@ sentry {
3535
}
3636

3737
kotlin {
38-
// androidTarget {
39-
// // https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-test.html
40-
// instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
41-
// }
38+
androidLibrary {
39+
namespace = "io.github.kdroidfilter.seforimapp"
40+
compileSdk = 36
41+
minSdk = 24
42+
}
4243

4344
jvm()
45+
listOf(iosArm64(), iosSimulatorArm64()).forEach { target ->
46+
target.binaries.framework {
47+
baseName = "SeforimApp"
48+
isStatic = true
49+
}
50+
}
4451
jvmToolchain(
4552
libs.versions.jvmToolchain
4653
.get()
@@ -57,7 +64,6 @@ kotlin {
5764

5865
// Ktor
5966
implementation(libs.ktor.client.core)
60-
implementation(libs.ktor.client.cio)
6167
implementation(libs.ktor.client.content.negotiation)
6268
implementation(libs.ktor.client.logging)
6369
implementation(libs.ktor.client.serialization)
@@ -80,12 +86,6 @@ kotlin {
8086

8187
// Settings & platform utils
8288
implementation(libs.multiplatformSettings)
83-
implementation(libs.nucleus.core.runtime)
84-
implementation(libs.nucleus.application)
85-
implementation(libs.nucleus.aot.runtime)
86-
implementation(libs.nucleus.darkmode.detector)
87-
implementation(libs.platformtools.appmanager)
88-
implementation(project(":releasefetcher"))
8989

9090
// FileKit
9191
implementation(libs.filekit.core)
@@ -103,15 +103,11 @@ kotlin {
103103
implementation(project(":navigation"))
104104
implementation(project(":pagination"))
105105
implementation(project(":texteffects"))
106-
implementation(project(":network"))
107106

108107
// Paging (AndroidX Paging 3)
109108
implementation(libs.androidx.paging.common)
110109
implementation(libs.androidx.paging.compose)
111110

112-
// System Info
113-
implementation(libs.nucleus.system.info)
114-
115111
implementation(libs.koalaplot.core)
116112

117113
implementation(libs.confettikit)
@@ -126,14 +122,22 @@ kotlin {
126122
implementation(libs.mockk)
127123
implementation(libs.kotlinx.coroutines.test)
128124
}
129-
//
130-
// androidMain.dependencies {
131-
// implementation(compose.uiTooling)
132-
// implementation(libs.androidx.activityCompose)
133-
// implementation(libs.ktor.client.okhttp)
134-
// }
125+
androidMain.dependencies {
126+
implementation(libs.androidx.activityCompose)
127+
}
135128

136129
jvmMain.dependencies {
130+
// Relocated from commonMain: JVM-only platform deps + desktop-only feature libs
131+
implementation(libs.nucleus.core.runtime)
132+
implementation(libs.nucleus.application)
133+
implementation(libs.nucleus.aot.runtime)
134+
implementation(libs.nucleus.darkmode.detector)
135+
implementation(libs.nucleus.system.info)
136+
implementation(libs.platformtools.appmanager)
137+
implementation(project(":releasefetcher"))
138+
implementation(project(":network"))
139+
implementation(libs.ktor.client.cio)
140+
137141
implementation(libs.hebrew.numerals)
138142
api(project(":jewel"))
139143
implementation(project(":earthwidget"))
@@ -192,27 +196,6 @@ kotlin {
192196
}
193197
}
194198

195-
// android {
196-
// namespace = "io.github.kdroidfilter.seforimapp"
197-
// compileSdk = 35
198-
//
199-
// defaultConfig {
200-
// applicationId = "io.github.kdroidfilter.seforimapp.androidApp"
201-
// minSdk = 21
202-
// targetSdk = 35
203-
// versionCode = 1
204-
// versionName = "1.0.0"
205-
//
206-
// testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
207-
// }
208-
// }
209-
//
210-
// // https://developer.android.com/develop/ui/compose/testing#setup
211-
// dependencies {
212-
// androidTestImplementation(libs.androidx.uitest.junit4)
213-
// debugImplementation(libs.androidx.uitest.testManifest)
214-
// }
215-
216199
nucleus.application {
217200

218201
mainClass = "io.github.kdroidfilter.seforimapp.MainKt"

SeforimApp/src/androidMain/kotlin/io/github/kdroidfilter/seforimapp/theme/Theme.android.kt

Lines changed: 0 additions & 19 deletions
This file was deleted.

SeforimApp/src/commonMain/composeResources/font/OpenSans-Italic-VariableFont_wdth,wght.ttf renamed to SeforimApp/src/commonMain/composeResources/font/OpenSans-Italic-VariableFont_wdth_wght.ttf

File renamed without changes.

SeforimApp/src/commonMain/composeResources/font/OpenSans-VariableFont_wdth,wght.ttf renamed to SeforimApp/src/commonMain/composeResources/font/OpenSans-VariableFont_wdth_wght.ttf

File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package io.github.kdroidfilter.seforimapp
2+
3+
import androidx.compose.foundation.layout.Box
4+
import androidx.compose.foundation.layout.fillMaxSize
5+
import androidx.compose.foundation.text.BasicText
6+
import androidx.compose.runtime.Composable
7+
import androidx.compose.ui.Alignment
8+
import androidx.compose.ui.Modifier
9+
10+
/**
11+
* Shared app entry composable used by the Android and iOS hosts.
12+
*
13+
* ponytail: stub for now — the full desktop UI is the Jewel-based window in jvmMain/main.kt,
14+
* which can't run on mobile. Implementing the real mobile UI (and the search engine) per platform
15+
* via expect/actual is the remaining work; this keeps Android/iOS launching with a placeholder.
16+
*/
17+
@Composable
18+
fun App() {
19+
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
20+
BasicText("זית")
21+
}
22+
}

SeforimApp/src/jvmMain/kotlin/io/github/kdroidfilter/seforimapp/core/MainAppState.kt renamed to SeforimApp/src/commonMain/kotlin/io/github/kdroidfilter/seforimapp/core/MainAppState.kt

File renamed without changes.

SeforimApp/src/jvmMain/kotlin/io/github/kdroidfilter/seforimapp/core/annotations/HighlightSelectionResolver.kt renamed to SeforimApp/src/commonMain/kotlin/io/github/kdroidfilter/seforimapp/core/annotations/HighlightSelectionResolver.kt

File renamed without changes.

SeforimApp/src/jvmMain/kotlin/io/github/kdroidfilter/seforimapp/core/catalog/CatalogAccess.kt renamed to SeforimApp/src/commonMain/kotlin/io/github/kdroidfilter/seforimapp/core/catalog/CatalogAccess.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CatalogAccess(
2424
val booksByCategory: Map<Long, List<BookRef>>,
2525
)
2626

27-
@Volatile
27+
@kotlin.concurrent.Volatile
2828
private var indices: Indices? = null
2929

3030
private fun resolve(): Indices? {

SeforimApp/src/jvmMain/kotlin/io/github/kdroidfilter/seforimapp/core/coroutines/CoroutineUtils.kt renamed to SeforimApp/src/commonMain/kotlin/io/github/kdroidfilter/seforimapp/core/coroutines/CoroutineUtils.kt

File renamed without changes.

SeforimApp/src/jvmMain/kotlin/io/github/kdroidfilter/seforimapp/core/presentation/components/HardDriveUpload.kt renamed to SeforimApp/src/commonMain/kotlin/io/github/kdroidfilter/seforimapp/core/presentation/components/HardDriveUpload.kt

File renamed without changes.

0 commit comments

Comments
 (0)