diff --git a/.gitignore b/.gitignore index 6d04bccee..867dcb603 100644 --- a/.gitignore +++ b/.gitignore @@ -3220,3 +3220,4 @@ /core/repository-kmp/build/generated/ksp/android/androidDebug/java/org/michaelbel/movies/repository/impl/SearchRepositoryImpl_Factory.java /core/repository-kmp/build/generated/ksp/android/androidDebug/java/org/michaelbel/movies/repository/impl/SettingsRepositoryImpl_Factory.java /core/repository-kmp/build/generated/ksp/android/androidDebug/java/org/michaelbel/movies/repository/impl/SuggestionRepositoryImpl_Factory.java +/.kotlin \ No newline at end of file diff --git a/core/analytics/build.gradle.kts b/core/analytics/build.gradle.kts index 92878353e..99b4aacba 100644 --- a/core/analytics/build.gradle.kts +++ b/core/analytics/build.gradle.kts @@ -9,7 +9,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -17,10 +17,6 @@ kotlin { sourceSets { commonMain.dependencies { implementation(project(":core:platform-services:interactor")) - implementation(libs.bundles.koin.common) - } - androidMain.dependencies { - implementation(libs.bundles.koin.android) } } diff --git a/core/analytics/src/desktopMain/kotlin/org/michaelbel/movies/analytics/di/MoviesAnalyticsKoinModule.desktop.kt b/core/analytics/src/jvmMain/kotlin/org/michaelbel/movies/analytics/di/MoviesAnalyticsKoinModule.desktop.kt similarity index 100% rename from core/analytics/src/desktopMain/kotlin/org/michaelbel/movies/analytics/di/MoviesAnalyticsKoinModule.desktop.kt rename to core/analytics/src/jvmMain/kotlin/org/michaelbel/movies/analytics/di/MoviesAnalyticsKoinModule.desktop.kt diff --git a/core/analytics/src/desktopMain/kotlin/org/michaelbel/movies/analytics/impl/MoviesAnalyticsImpl.kt b/core/analytics/src/jvmMain/kotlin/org/michaelbel/movies/analytics/impl/MoviesAnalyticsImpl.kt similarity index 100% rename from core/analytics/src/desktopMain/kotlin/org/michaelbel/movies/analytics/impl/MoviesAnalyticsImpl.kt rename to core/analytics/src/jvmMain/kotlin/org/michaelbel/movies/analytics/impl/MoviesAnalyticsImpl.kt diff --git a/core/common/build.gradle.kts b/core/common/build.gradle.kts index ea9dd60f6..9542c42dd 100644 --- a/core/common/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -11,17 +11,17 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() sourceSets { commonMain.dependencies { + api(libs.bundles.kotlinx.coroutines.common) api(libs.bundles.kotlinx.datetime.common) api(libs.bundles.koin.common) implementation(compose.material3) - implementation(libs.bundles.kotlinx.coroutines.common) } androidMain.dependencies { api(libs.bundles.kotlinx.coroutines.android) @@ -32,13 +32,12 @@ kotlin { api(libs.bundles.startup.android) api(libs.bundles.work.android) api(libs.bundles.timber.android) - api(libs.bundles.koin.compose.work.android) + api(libs.bundles.koin.android) implementation(libs.bundles.appcompat.android) implementation(libs.bundles.browser.android) - implementation(libs.bundles.paging.common) // fixme ломает navigation + implementation(libs.bundles.paging.common) } - val desktopMain by getting - desktopMain.dependencies { + jvmMain.dependencies { api(libs.bundles.kotlinx.coroutines.desktop) api(libs.bundles.jetbrains.androidx.lifecycle.viewmodel.compose.common) } diff --git a/core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/browser/Browser.desktop.kt b/core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/browser/Browser.desktop.kt similarity index 100% rename from core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/browser/Browser.desktop.kt rename to core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/browser/Browser.desktop.kt diff --git a/core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/dispatchers/UiDispatcher.desktop.kt b/core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/dispatchers/UiDispatcher.desktop.kt similarity index 100% rename from core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/dispatchers/UiDispatcher.desktop.kt rename to core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/dispatchers/UiDispatcher.desktop.kt diff --git a/core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/ktx/SavedStateHandleKtx.desktop.kt b/core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/ktx/SavedStateHandleKtx.desktop.kt similarity index 100% rename from core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/ktx/SavedStateHandleKtx.desktop.kt rename to core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/ktx/SavedStateHandleKtx.desktop.kt diff --git a/core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/log/Logger.desktop.kt b/core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/log/Logger.desktop.kt similarity index 100% rename from core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/log/Logger.desktop.kt rename to core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/log/Logger.desktop.kt diff --git a/core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/viewmodel/BaseViewModel.kt b/core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/viewmodel/BaseViewModel.kt similarity index 100% rename from core/common/src/desktopMain/kotlin/org/michaelbel/movies/common/viewmodel/BaseViewModel.kt rename to core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/viewmodel/BaseViewModel.kt diff --git a/core/interactor/build.gradle.kts b/core/interactor/build.gradle.kts index f1aa3b652..e4a3cb8b0 100644 --- a/core/interactor/build.gradle.kts +++ b/core/interactor/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,9 +20,6 @@ kotlin { commonMain.dependencies { api(project(":core:analytics")) api(project(":core:repository")) - implementation(compose.runtime) - implementation(compose.runtimeSaveable) - implementation(libs.bundles.kotlinx.coroutines.common) implementation(libs.bundles.room.paging.common) } } diff --git a/core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/MovieBlockingInteractor.kt b/core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/MovieBlockingInteractor.kt similarity index 100% rename from core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/MovieBlockingInteractor.kt rename to core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/MovieBlockingInteractor.kt diff --git a/core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/di/InteractorBlockingKoinModule.desktop.kt b/core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/di/InteractorBlockingKoinModule.desktop.kt similarity index 100% rename from core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/di/InteractorBlockingKoinModule.desktop.kt rename to core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/di/InteractorBlockingKoinModule.desktop.kt diff --git a/core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/di/InteractorLocaleKoinModule.desktop.kt b/core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/di/InteractorLocaleKoinModule.desktop.kt similarity index 100% rename from core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/di/InteractorLocaleKoinModule.desktop.kt rename to core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/di/InteractorLocaleKoinModule.desktop.kt diff --git a/core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/impl/LocaleInteractorImpl.kt b/core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/impl/LocaleInteractorImpl.kt similarity index 100% rename from core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/impl/LocaleInteractorImpl.kt rename to core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/impl/LocaleInteractorImpl.kt diff --git a/core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/impl/MovieBlockingInteractorImpl.kt b/core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/impl/MovieBlockingInteractorImpl.kt similarity index 100% rename from core/interactor/src/desktopMain/kotlin/org/michaelbel/movies/interactor/impl/MovieBlockingInteractorImpl.kt rename to core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/impl/MovieBlockingInteractorImpl.kt diff --git a/core/navigation/build.gradle.kts b/core/navigation/build.gradle.kts index 7c78af269..3ef95d072 100644 --- a/core/navigation/build.gradle.kts +++ b/core/navigation/build.gradle.kts @@ -9,7 +9,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -22,8 +22,7 @@ kotlin { api(libs.bundles.jetbrains.androidx.navigation.compose.common) api(libs.bundles.jetbrains.androidx.core.bundle.common) } - val desktopMain by getting - desktopMain.dependencies { + jvmMain.dependencies { api(libs.bundles.jetbrains.androidx.lifecycle.viewmodel.compose.common) } } diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index 44d30cb0b..3ceb0e818 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -19,22 +19,21 @@ private val tmdbApiKey: String by lazy { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() sourceSets { commonMain.dependencies { - implementation(libs.bundles.kotlinx.serialization.common) + api(project(":core:common")) + api(libs.bundles.kotlinx.serialization.common) implementation(libs.bundles.ktor.common) - implementation(libs.bundles.koin.common) } androidMain.dependencies { implementation(libs.bundles.ktor.android) implementation(libs.bundles.startup.android) implementation(libs.bundles.okhttp.logging.interceptor.android) - implementation(libs.bundles.koin.android) } } diff --git a/core/network/src/desktopMain/kotlin/org/michaelbel/movies/network/config/Interceptor.desktop.kt b/core/network/src/jvmMain/kotlin/org/michaelbel/movies/network/config/Interceptor.desktop.kt similarity index 100% rename from core/network/src/desktopMain/kotlin/org/michaelbel/movies/network/config/Interceptor.desktop.kt rename to core/network/src/jvmMain/kotlin/org/michaelbel/movies/network/config/Interceptor.desktop.kt diff --git a/core/network/src/desktopMain/kotlin/org/michaelbel/movies/network/config/TmdbConfig.desktop.kt b/core/network/src/jvmMain/kotlin/org/michaelbel/movies/network/config/TmdbConfig.desktop.kt similarity index 100% rename from core/network/src/desktopMain/kotlin/org/michaelbel/movies/network/config/TmdbConfig.desktop.kt rename to core/network/src/jvmMain/kotlin/org/michaelbel/movies/network/config/TmdbConfig.desktop.kt diff --git a/core/network/src/desktopMain/kotlin/org/michaelbel/movies/network/connectivity/NetworkManager.kt b/core/network/src/jvmMain/kotlin/org/michaelbel/movies/network/connectivity/NetworkManager.kt similarity index 100% rename from core/network/src/desktopMain/kotlin/org/michaelbel/movies/network/connectivity/NetworkManager.kt rename to core/network/src/jvmMain/kotlin/org/michaelbel/movies/network/connectivity/NetworkManager.kt diff --git a/core/network/src/desktopMain/kotlin/org/michaelbel/movies/network/ktor/di/KtorKoinModule.desktop.kt b/core/network/src/jvmMain/kotlin/org/michaelbel/movies/network/ktor/di/KtorKoinModule.desktop.kt similarity index 100% rename from core/network/src/desktopMain/kotlin/org/michaelbel/movies/network/ktor/di/KtorKoinModule.desktop.kt rename to core/network/src/jvmMain/kotlin/org/michaelbel/movies/network/ktor/di/KtorKoinModule.desktop.kt diff --git a/core/notifications/build.gradle.kts b/core/notifications/build.gradle.kts index 55e5176a0..08777654b 100644 --- a/core/notifications/build.gradle.kts +++ b/core/notifications/build.gradle.kts @@ -9,7 +9,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() diff --git a/core/persistence/build.gradle.kts b/core/persistence/build.gradle.kts index c24bca869..65ba4333c 100644 --- a/core/persistence/build.gradle.kts +++ b/core/persistence/build.gradle.kts @@ -11,14 +11,13 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() sourceSets { commonMain.dependencies { - api(project(":core:common")) api(project(":core:network")) implementation(libs.bundles.datastore.common) implementation(libs.bundles.room.common) @@ -28,8 +27,7 @@ kotlin { androidMain.dependencies { implementation(libs.bundles.datastore.android) } - val desktopMain by getting - desktopMain.dependencies { + jvmMain.dependencies { implementation(libs.bundles.datastore.desktop) } } @@ -62,7 +60,10 @@ android { dependencies { add("kspAndroid", libs.bundles.room.compiler.common) - add("kspDesktop", libs.bundles.room.compiler.common) + add("kspJvm", libs.bundles.room.compiler.common) + add("kspIosX64", libs.bundles.room.compiler.common) + add("kspIosArm64", libs.bundles.room.compiler.common) + add("kspIosSimulatorArm64", libs.bundles.room.compiler.common) } room { diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt index 9ca52ab18..4dbb3bf2a 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt @@ -39,6 +39,6 @@ abstract class AppDatabase: RoomDatabase() { companion object { const val DATABASE_NAME = "movies.db" - const val DATABASE_VERSION = 27 + const val DATABASE_VERSION = 28 } } \ No newline at end of file diff --git a/core/persistence/src/iosMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.ios.kt b/core/persistence/src/iosMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.ios.kt index 47469217c..a794e6f45 100644 --- a/core/persistence/src/iosMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.ios.kt +++ b/core/persistence/src/iosMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.ios.kt @@ -2,4 +2,15 @@ package org.michaelbel.movies.persistence.database.di import org.koin.dsl.module -actual val databaseKoinModule = module {} \ No newline at end of file +actual val databaseKoinModule = module { + //single { createRoomDatabase().build() } +} + +/* +private fun createRoomDatabase(): RoomDatabase.Builder { + val dbFile = NSHomeDirectory() + "/${AppDatabase.DATABASE_NAME}" + return Room.databaseBuilder( + name = dbFile, + factory = { AppDatabase::class.instantiateImpl() } // IDE may show error but there is none. + ) +}*/ diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/MovieBlockingPersistence.kt b/core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/MovieBlockingPersistence.kt similarity index 100% rename from core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/MovieBlockingPersistence.kt rename to core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/MovieBlockingPersistence.kt diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/MoviesDatabase.kt b/core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/MoviesDatabase.kt similarity index 100% rename from core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/MoviesDatabase.kt rename to core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/MoviesDatabase.kt diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieBlockingDao.kt b/core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieBlockingDao.kt similarity index 100% rename from core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieBlockingDao.kt rename to core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieBlockingDao.kt diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.desktop.kt b/core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.desktop.kt similarity index 100% rename from core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.desktop.kt rename to core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.desktop.kt diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/MoviesDatabaseKoinModule.desktop.kt b/core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/di/MoviesDatabaseKoinModule.desktop.kt similarity index 100% rename from core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/MoviesDatabaseKoinModule.desktop.kt rename to core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/di/MoviesDatabaseKoinModule.desktop.kt diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceBlockingKoinModule.desktop.kt b/core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceBlockingKoinModule.desktop.kt similarity index 100% rename from core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceBlockingKoinModule.desktop.kt rename to core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceBlockingKoinModule.desktop.kt diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/datastore/di/DataStoreKoinModule.desktop.kt b/core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/datastore/di/DataStoreKoinModule.desktop.kt similarity index 100% rename from core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/datastore/di/DataStoreKoinModule.desktop.kt rename to core/persistence/src/jvmMain/kotlin/org/michaelbel/movies/persistence/datastore/di/DataStoreKoinModule.desktop.kt diff --git a/core/platform-services/foss/build.gradle.kts b/core/platform-services/foss/build.gradle.kts index d9ef063be..3b64058d6 100644 --- a/core/platform-services/foss/build.gradle.kts +++ b/core/platform-services/foss/build.gradle.kts @@ -9,16 +9,14 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() sourceSets { commonMain.dependencies { - implementation(project(":core:platform-services:interactor")) - implementation(libs.bundles.kotlinx.coroutines.common) - implementation(libs.bundles.koin.common) + api(project(":core:platform-services:interactor")) } } diff --git a/core/platform-services/foss/src/desktopMain/kotlin/org/michaelbel/movies/platform/impl/analytics/AnalyticsServiceImpl.kt b/core/platform-services/foss/src/jvmMain/kotlin/org/michaelbel/movies/platform/impl/analytics/AnalyticsServiceImpl.kt similarity index 100% rename from core/platform-services/foss/src/desktopMain/kotlin/org/michaelbel/movies/platform/impl/analytics/AnalyticsServiceImpl.kt rename to core/platform-services/foss/src/jvmMain/kotlin/org/michaelbel/movies/platform/impl/analytics/AnalyticsServiceImpl.kt diff --git a/core/platform-services/foss/src/desktopMain/kotlin/org/michaelbel/movies/platform/impl/review/ReviewServiceImpl.kt b/core/platform-services/foss/src/jvmMain/kotlin/org/michaelbel/movies/platform/impl/review/ReviewServiceImpl.kt similarity index 100% rename from core/platform-services/foss/src/desktopMain/kotlin/org/michaelbel/movies/platform/impl/review/ReviewServiceImpl.kt rename to core/platform-services/foss/src/jvmMain/kotlin/org/michaelbel/movies/platform/impl/review/ReviewServiceImpl.kt diff --git a/core/platform-services/foss/src/desktopMain/kotlin/org/michaelbel/movies/platform/impl/update/UpdateServiceImpl.kt b/core/platform-services/foss/src/jvmMain/kotlin/org/michaelbel/movies/platform/impl/update/UpdateServiceImpl.kt similarity index 100% rename from core/platform-services/foss/src/desktopMain/kotlin/org/michaelbel/movies/platform/impl/update/UpdateServiceImpl.kt rename to core/platform-services/foss/src/jvmMain/kotlin/org/michaelbel/movies/platform/impl/update/UpdateServiceImpl.kt diff --git a/core/platform-services/gms/build.gradle.kts b/core/platform-services/gms/build.gradle.kts index 97823e57a..1497b003e 100644 --- a/core/platform-services/gms/build.gradle.kts +++ b/core/platform-services/gms/build.gradle.kts @@ -9,19 +9,16 @@ plugins { kotlin { androidTarget() - jvm("desktop") sourceSets { commonMain.dependencies { - implementation(project(":core:platform-services:interactor")) + api(project(":core:platform-services:interactor")) implementation(project(":core:notifications")) - implementation(libs.bundles.koin.common) } androidMain.dependencies { api(libs.bundles.google.firebase.android) api(libs.bundles.google.services.android) api(libs.bundles.google.play.android) - implementation(libs.bundles.koin.android) } } diff --git a/core/platform-services/hms/build.gradle.kts b/core/platform-services/hms/build.gradle.kts index 4e0f59dd3..f130e3976 100644 --- a/core/platform-services/hms/build.gradle.kts +++ b/core/platform-services/hms/build.gradle.kts @@ -9,13 +9,10 @@ plugins { kotlin { androidTarget() - jvm("desktop") sourceSets { commonMain.dependencies { - implementation(project(":core:platform-services:interactor")) - implementation(libs.bundles.kotlinx.coroutines.common) - implementation(libs.bundles.koin.common) + api(project(":core:platform-services:interactor")) } } diff --git a/core/platform-services/inject-android/build.gradle.kts b/core/platform-services/inject-android/build.gradle.kts index 6f745a8c9..339611f3a 100644 --- a/core/platform-services/inject-android/build.gradle.kts +++ b/core/platform-services/inject-android/build.gradle.kts @@ -9,15 +9,10 @@ plugins { kotlin { androidTarget() - jvm("desktop") sourceSets { commonMain.dependencies { - implementation(project(":core:platform-services:interactor")) - implementation(libs.bundles.koin.common) - } - androidMain.dependencies { - implementation(libs.bundles.koin.android) + api(project(":core:platform-services:interactor")) } } diff --git a/core/platform-services/inject-desktop/build.gradle.kts b/core/platform-services/inject-desktop/build.gradle.kts index 33ce3bd87..a49668b64 100644 --- a/core/platform-services/inject-desktop/build.gradle.kts +++ b/core/platform-services/inject-desktop/build.gradle.kts @@ -3,13 +3,11 @@ plugins { } kotlin { - jvm("desktop") + jvm() sourceSets { commonMain.dependencies { - implementation(project(":core:platform-services:interactor")) implementation(project(":core:platform-services:foss")) - implementation(libs.bundles.koin.common) } } } \ No newline at end of file diff --git a/core/platform-services/inject-ios/build.gradle.kts b/core/platform-services/inject-ios/build.gradle.kts index 95b27f643..496541d50 100644 --- a/core/platform-services/inject-ios/build.gradle.kts +++ b/core/platform-services/inject-ios/build.gradle.kts @@ -9,9 +9,7 @@ kotlin { sourceSets { commonMain.dependencies { - implementation(project(":core:platform-services:interactor")) implementation(project(":core:platform-services:foss")) - implementation(libs.bundles.koin.common) } } } \ No newline at end of file diff --git a/core/platform-services/interactor/build.gradle.kts b/core/platform-services/interactor/build.gradle.kts index eadaa226e..c3a22acd9 100644 --- a/core/platform-services/interactor/build.gradle.kts +++ b/core/platform-services/interactor/build.gradle.kts @@ -9,14 +9,14 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() sourceSets { commonMain.dependencies { - implementation(libs.bundles.kotlinx.coroutines.common) + api(project(":core:common")) } } diff --git a/core/platform-services/interactor/src/desktopMain/kotlin/org/michaelbel/movies/platform/analytics/AnalyticsService.kt b/core/platform-services/interactor/src/jvmMain/kotlin/org/michaelbel/movies/platform/analytics/AnalyticsService.kt similarity index 100% rename from core/platform-services/interactor/src/desktopMain/kotlin/org/michaelbel/movies/platform/analytics/AnalyticsService.kt rename to core/platform-services/interactor/src/jvmMain/kotlin/org/michaelbel/movies/platform/analytics/AnalyticsService.kt diff --git a/core/platform-services/interactor/src/desktopMain/kotlin/org/michaelbel/movies/platform/review/ReviewService.kt b/core/platform-services/interactor/src/jvmMain/kotlin/org/michaelbel/movies/platform/review/ReviewService.kt similarity index 100% rename from core/platform-services/interactor/src/desktopMain/kotlin/org/michaelbel/movies/platform/review/ReviewService.kt rename to core/platform-services/interactor/src/jvmMain/kotlin/org/michaelbel/movies/platform/review/ReviewService.kt diff --git a/core/platform-services/interactor/src/desktopMain/kotlin/org/michaelbel/movies/platform/update/UpdateService.kt b/core/platform-services/interactor/src/jvmMain/kotlin/org/michaelbel/movies/platform/update/UpdateService.kt similarity index 100% rename from core/platform-services/interactor/src/desktopMain/kotlin/org/michaelbel/movies/platform/update/UpdateService.kt rename to core/platform-services/interactor/src/jvmMain/kotlin/org/michaelbel/movies/platform/update/UpdateService.kt diff --git a/core/repository/build.gradle.kts b/core/repository/build.gradle.kts index 032eae2a7..cbb4d80b7 100644 --- a/core/repository/build.gradle.kts +++ b/core/repository/build.gradle.kts @@ -9,7 +9,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -17,7 +17,6 @@ kotlin { sourceSets { commonMain.dependencies { api(project(":core:persistence")) - implementation(libs.bundles.kotlinx.coroutines.common) implementation(libs.bundles.room.paging.common) } } diff --git a/core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/MovieBlockingRepository.kt b/core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/MovieBlockingRepository.kt similarity index 100% rename from core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/MovieBlockingRepository.kt rename to core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/MovieBlockingRepository.kt diff --git a/core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/di/RepositoryBlockingKoinModule.desktop.kt b/core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/di/RepositoryBlockingKoinModule.desktop.kt similarity index 100% rename from core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/di/RepositoryBlockingKoinModule.desktop.kt rename to core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/di/RepositoryBlockingKoinModule.desktop.kt diff --git a/core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/impl/MovieBlockingRepositoryImpl.kt b/core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/impl/MovieBlockingRepositoryImpl.kt similarity index 100% rename from core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/impl/MovieBlockingRepositoryImpl.kt rename to core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/impl/MovieBlockingRepositoryImpl.kt diff --git a/core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/ktx/BuildKtx.desktop.kt b/core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/ktx/BuildKtx.desktop.kt similarity index 100% rename from core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/ktx/BuildKtx.desktop.kt rename to core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/ktx/BuildKtx.desktop.kt diff --git a/core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/ktx/ExceptionKtx.desktop.kt b/core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/ktx/ExceptionKtx.desktop.kt similarity index 100% rename from core/repository/src/desktopMain/kotlin/org/michaelbel/movies/repository/ktx/ExceptionKtx.desktop.kt rename to core/repository/src/jvmMain/kotlin/org/michaelbel/movies/repository/ktx/ExceptionKtx.desktop.kt diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index 2a749953b..08cf8cc09 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -11,25 +11,27 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() sourceSets { commonMain.dependencies { - implementation(project(":core:persistence")) - implementation(libs.bundles.lifecycle.common) + api(project(":core:persistence")) api(libs.bundles.coil.common) - implementation(libs.bundles.constraintlayout.common) - implementation(compose.components.resources) - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.material3) - implementation(compose.runtime) - implementation(compose.runtimeSaveable) + api(libs.bundles.constraintlayout.common) + api(compose.animation) + api(compose.foundation) + api(compose.runtime) + api(compose.runtimeSaveable) + api(compose.ui) + api(compose.material) + api(compose.material3) + api(compose.components.resources) + api(compose.components.uiToolingPreview) implementation(compose.materialIconsExtended) - implementation(compose.ui) + implementation(libs.bundles.lifecycle.common) } androidMain.dependencies { api(libs.bundles.core.splashscreen.android) @@ -37,7 +39,11 @@ kotlin { api(libs.bundles.coil.android) api(libs.bundles.compose.android) api(libs.bundles.google.material.android) - implementation(libs.bundles.paging.common) // fixme ломает navigation + implementation(libs.bundles.paging.common) + } + jvmMain.dependencies { + api(compose.desktop.common) + api(compose.desktop.currentOs) } } diff --git a/core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/compose/page/PageContent.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageContent.desktop.kt similarity index 100% rename from core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/compose/page/PageContent.desktop.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageContent.desktop.kt diff --git a/core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.desktop.kt similarity index 100% rename from core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.desktop.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.desktop.kt diff --git a/core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.desktop.kt similarity index 100% rename from core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.desktop.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.desktop.kt diff --git a/core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/ktx/ConfigurationKtx.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/ConfigurationKtx.desktop.kt similarity index 100% rename from core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/ktx/ConfigurationKtx.desktop.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/ConfigurationKtx.desktop.kt diff --git a/core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/ktx/LazyPagingItemsKtx.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/LazyPagingItemsKtx.desktop.kt similarity index 100% rename from core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/ktx/LazyPagingItemsKtx.desktop.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/LazyPagingItemsKtx.desktop.kt diff --git a/core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/ktx/LifecycleKtx.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/LifecycleKtx.desktop.kt similarity index 100% rename from core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/ktx/LifecycleKtx.desktop.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/LifecycleKtx.desktop.kt diff --git a/core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/ktx/WindowInsetsKtx.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/WindowInsetsKtx.desktop.kt similarity index 100% rename from core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/ktx/WindowInsetsKtx.desktop.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/WindowInsetsKtx.desktop.kt diff --git a/core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/theme/Theme.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/theme/Theme.desktop.kt similarity index 100% rename from core/ui/src/desktopMain/kotlin/org/michaelbel/movies/ui/theme/Theme.desktop.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/theme/Theme.desktop.kt diff --git a/core/widget/build.gradle.kts b/core/widget/build.gradle.kts index 185170e61..64e700dd0 100644 --- a/core/widget/build.gradle.kts +++ b/core/widget/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -21,11 +21,8 @@ kotlin { implementation(project(":core:interactor")) implementation(project(":core:ui")) implementation(project(":core:work")) - implementation(libs.bundles.kotlinx.serialization.common) - implementation(libs.bundles.datastore.common) } androidMain.dependencies { - implementation(libs.bundles.datastore.android) implementation(libs.bundles.glance.android) } } diff --git a/core/work/build.gradle.kts b/core/work/build.gradle.kts index 52678acec..d01ba4c3d 100644 --- a/core/work/build.gradle.kts +++ b/core/work/build.gradle.kts @@ -9,7 +9,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -18,7 +18,6 @@ kotlin { commonMain.dependencies { implementation(project(":core:interactor")) implementation(project(":core:notifications")) - implementation(libs.bundles.kotlinx.serialization.common) } androidMain.dependencies { implementation(libs.bundles.work.android) diff --git a/desktopApp/build.gradle.kts b/desktopApp/build.gradle.kts index 4704eed3d..4cd521df5 100755 --- a/desktopApp/build.gradle.kts +++ b/desktopApp/build.gradle.kts @@ -13,15 +13,6 @@ kotlin { jvmMain.dependencies { implementation(project(":core:platform-services:inject-desktop")) implementation(project(":feature:main-impl")) - implementation(compose.desktop.currentOs) - implementation(compose.desktop.common) - implementation(compose.runtime) - implementation(compose.foundation) - implementation(compose.animation) - implementation(compose.material) - implementation(compose.material3) - implementation(compose.components.resources) - implementation(libs.koin.compose) } } } diff --git a/desktopApp/src/jvmMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt b/desktopApp/src/jvmMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt index 3ae5d8fd5..069b810a8 100644 --- a/desktopApp/src/jvmMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt +++ b/desktopApp/src/jvmMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt @@ -21,6 +21,6 @@ internal val appKoinModule = module { feedKoinModule, galleryKoinModule, searchKoinModule, - settingsKoinModule, + settingsKoinModule ) } \ No newline at end of file diff --git a/desktopApp/user_preferences.preferences_pb b/desktopApp/user_preferences.preferences_pb deleted file mode 100644 index a9531bb9c..000000000 Binary files a/desktopApp/user_preferences.preferences_pb and /dev/null differ diff --git a/feature/account-impl/build.gradle.kts b/feature/account-impl/build.gradle.kts index 5edf2ae97..8e851e820 100644 --- a/feature/account-impl/build.gradle.kts +++ b/feature/account-impl/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -22,19 +22,10 @@ kotlin { api(project(":core:ui")) api(project(":core:common")) api(project(":core:interactor")) - implementation(compose.components.resources) - implementation(compose.foundation) - implementation(compose.material3) - implementation(compose.runtime) - implementation(libs.bundles.constraintlayout.common) } androidMain.dependencies { implementation(libs.bundles.work.android) } - val desktopMain by getting - desktopMain.dependencies { - implementation(libs.koin.compose) - } } compilerOptions { diff --git a/feature/account-impl/src/iosMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.ios.kt b/feature/account-impl/src/iosMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.ios.kt index f3704110a..36b4e9ab1 100644 --- a/feature/account-impl/src/iosMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.ios.kt +++ b/feature/account-impl/src/iosMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.ios.kt @@ -1,15 +1,20 @@ package org.michaelbel.movies.account.ui import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import org.koin.compose.koinInject +import org.michaelbel.movies.account.AccountViewModel +import org.michaelbel.movies.persistence.database.ktx.orEmpty +import org.michaelbel.movies.ui.ktx.collectAsStateCommon @Composable fun AccountRoute( onBackClick: () -> Unit, modifier: Modifier = Modifier, - //viewModel: AccountViewModel = koinInject() + viewModel: AccountViewModel = koinInject() ) { - /*val account by viewModel.account.collectAsStateCommon() + val account by viewModel.account.collectAsStateCommon() AccountScreenContent( account = account.orEmpty, @@ -17,5 +22,5 @@ fun AccountRoute( onBackClick = onBackClick, onLogoutClick = { viewModel.onLogoutClick(onBackClick) }, modifier = modifier - )*/ + ) } \ No newline at end of file diff --git a/feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/AccountViewModel.kt b/feature/account-impl/src/jvmMain/kotlin/org/michaelbel/movies/account/AccountViewModel.kt similarity index 100% rename from feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/AccountViewModel.kt rename to feature/account-impl/src/jvmMain/kotlin/org/michaelbel/movies/account/AccountViewModel.kt diff --git a/feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/di/AccountKoinModule.desktop.kt b/feature/account-impl/src/jvmMain/kotlin/org/michaelbel/movies/account/di/AccountKoinModule.desktop.kt similarity index 100% rename from feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/di/AccountKoinModule.desktop.kt rename to feature/account-impl/src/jvmMain/kotlin/org/michaelbel/movies/account/di/AccountKoinModule.desktop.kt diff --git a/feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.desktop.kt b/feature/account-impl/src/jvmMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.desktop.kt similarity index 100% rename from feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.desktop.kt rename to feature/account-impl/src/jvmMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.desktop.kt diff --git a/feature/account/build.gradle.kts b/feature/account/build.gradle.kts index 643a45777..0e55f201d 100644 --- a/feature/account/build.gradle.kts +++ b/feature/account/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,10 +20,6 @@ kotlin { commonMain.dependencies { api(project(":feature:account-impl")) } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.material3) - } } compilerOptions { diff --git a/feature/account/src/desktopMain/kotlin/org/michaelbel/movies/account/AccountNavigation.desktop.kt b/feature/account/src/jvmMain/kotlin/org/michaelbel/movies/account/AccountNavigation.desktop.kt similarity index 100% rename from feature/account/src/desktopMain/kotlin/org/michaelbel/movies/account/AccountNavigation.desktop.kt rename to feature/account/src/jvmMain/kotlin/org/michaelbel/movies/account/AccountNavigation.desktop.kt diff --git a/feature/auth-impl/build.gradle.kts b/feature/auth-impl/build.gradle.kts index 4ae00dae8..2f01890ea 100644 --- a/feature/auth-impl/build.gradle.kts +++ b/feature/auth-impl/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -22,17 +22,6 @@ kotlin { api(project(":core:ui")) api(project(":core:common")) api(project(":core:interactor")) - implementation(compose.components.resources) - implementation(compose.material3) - implementation(libs.bundles.constraintlayout.common) - } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.material3) - implementation(compose.runtime) - implementation(libs.koin.compose) } } diff --git a/feature/auth-impl/src/iosMain/kotlin/org/michaelbel/movies/auth/ui/AuthRoute.ios.kt b/feature/auth-impl/src/iosMain/kotlin/org/michaelbel/movies/auth/ui/AuthRoute.ios.kt index 470e17522..e52495e92 100644 --- a/feature/auth-impl/src/iosMain/kotlin/org/michaelbel/movies/auth/ui/AuthRoute.ios.kt +++ b/feature/auth-impl/src/iosMain/kotlin/org/michaelbel/movies/auth/ui/AuthRoute.ios.kt @@ -2,14 +2,17 @@ package org.michaelbel.movies.auth.ui import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import org.koin.compose.koinInject +import org.michaelbel.movies.auth.AuthViewModel +import org.michaelbel.movies.common.browser.openUrl @Composable fun AuthRoute( onBackClick: () -> Unit, modifier: Modifier = Modifier, - //viewModel: AuthViewModel = koinInject() + viewModel: AuthViewModel = koinInject() ) { - /*AuthScreenContent( + AuthScreenContent( error = null, signInLoading = false, loginLoading = false, @@ -20,5 +23,5 @@ fun AuthRoute( onResetRequestToken = {}, onUrlClick = { url -> openUrl(url) }, modifier = modifier - )*/ + ) } \ No newline at end of file diff --git a/feature/auth-impl/src/desktopMain/kotlin/org/michaelbel/movies/auth/AuthViewModel.kt b/feature/auth-impl/src/jvmMain/kotlin/org/michaelbel/movies/auth/AuthViewModel.kt similarity index 100% rename from feature/auth-impl/src/desktopMain/kotlin/org/michaelbel/movies/auth/AuthViewModel.kt rename to feature/auth-impl/src/jvmMain/kotlin/org/michaelbel/movies/auth/AuthViewModel.kt diff --git a/feature/auth-impl/src/desktopMain/kotlin/org/michaelbel/movies/auth/di/AuthKoinModule.desktop.kt b/feature/auth-impl/src/jvmMain/kotlin/org/michaelbel/movies/auth/di/AuthKoinModule.desktop.kt similarity index 100% rename from feature/auth-impl/src/desktopMain/kotlin/org/michaelbel/movies/auth/di/AuthKoinModule.desktop.kt rename to feature/auth-impl/src/jvmMain/kotlin/org/michaelbel/movies/auth/di/AuthKoinModule.desktop.kt diff --git a/feature/auth-impl/src/desktopMain/kotlin/org/michaelbel/movies/auth/ui/AuthRoute.desktop.kt b/feature/auth-impl/src/jvmMain/kotlin/org/michaelbel/movies/auth/ui/AuthRoute.desktop.kt similarity index 100% rename from feature/auth-impl/src/desktopMain/kotlin/org/michaelbel/movies/auth/ui/AuthRoute.desktop.kt rename to feature/auth-impl/src/jvmMain/kotlin/org/michaelbel/movies/auth/ui/AuthRoute.desktop.kt diff --git a/feature/auth/build.gradle.kts b/feature/auth/build.gradle.kts index 91e8ea382..4eb5e6124 100644 --- a/feature/auth/build.gradle.kts +++ b/feature/auth/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,11 +20,6 @@ kotlin { commonMain.dependencies { api(project(":feature:auth-impl")) } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.material) - implementation(compose.material3) - } } compilerOptions { diff --git a/feature/auth/src/desktopMain/kotlin/org/michaelbel/movies/auth/AuthNavigation.desktop.kt b/feature/auth/src/jvmMain/kotlin/org/michaelbel/movies/auth/AuthNavigation.desktop.kt similarity index 100% rename from feature/auth/src/desktopMain/kotlin/org/michaelbel/movies/auth/AuthNavigation.desktop.kt rename to feature/auth/src/jvmMain/kotlin/org/michaelbel/movies/auth/AuthNavigation.desktop.kt diff --git a/feature/auth/src/desktopMain/kotlin/org/michaelbel/movies/auth/Settings.desktop.kt b/feature/auth/src/jvmMain/kotlin/org/michaelbel/movies/auth/Settings.desktop.kt similarity index 100% rename from feature/auth/src/desktopMain/kotlin/org/michaelbel/movies/auth/Settings.desktop.kt rename to feature/auth/src/jvmMain/kotlin/org/michaelbel/movies/auth/Settings.desktop.kt diff --git a/feature/debug-impl/build.gradle.kts b/feature/debug-impl/build.gradle.kts index c0773b505..ee535b60d 100644 --- a/feature/debug-impl/build.gradle.kts +++ b/feature/debug-impl/build.gradle.kts @@ -14,7 +14,6 @@ kotlin { sourceSets { commonMain.dependencies { - api(project(":core:common")) api(project(":core:ui")) implementation(project(":core:platform-services:interactor")) implementation(project(":core:interactor")) diff --git a/feature/details-impl/build.gradle.kts b/feature/details-impl/build.gradle.kts index 232f22d36..5b8cd0311 100644 --- a/feature/details-impl/build.gradle.kts +++ b/feature/details-impl/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,19 +20,7 @@ kotlin { commonMain.dependencies { api(project(":core:navigation")) api(project(":core:ui")) - api(project(":core:common")) api(project(":core:interactor")) - implementation(compose.components.resources) - implementation(compose.material3) - implementation(libs.bundles.constraintlayout.common) - } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.material3) - implementation(compose.runtime) - implementation(libs.koin.compose) } } diff --git a/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/DetailsViewModel.kt b/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/DetailsViewModel.kt index 55451f266..8a35d6604 100644 --- a/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/DetailsViewModel.kt +++ b/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/DetailsViewModel.kt @@ -17,7 +17,7 @@ class DetailsViewModel( ): BaseViewModel() { private val movieList: PagingKey? = savedStateHandle["movieList"] - private val movieId: MovieId = 0//savedStateHandle.require("movieId") + private val movieId: MovieId = savedStateHandle["movieId"] ?: 0 private val _detailsState = MutableStateFlow(ScreenState.Loading) val detailsState = _detailsState.asStateFlow() diff --git a/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsRoute.ios.kt b/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsRoute.ios.kt index 9102a68ff..17b69ad65 100644 --- a/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsRoute.ios.kt +++ b/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsRoute.ios.kt @@ -1,22 +1,29 @@ package org.michaelbel.movies.details.ui import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.lifecycle.createSavedStateHandle +import androidx.lifecycle.viewmodel.compose.viewModel +import org.koin.compose.koinInject +import org.michaelbel.movies.details.DetailsViewModel +import org.michaelbel.movies.interactor.Interactor +import org.michaelbel.movies.ui.ktx.collectAsStateCommon @Composable fun DetailsRoute( onBackClick: () -> Unit, onNavigateToGallery: (Int) -> Unit, modifier: Modifier = Modifier, - //interactor: Interactor = koinInject(), - //viewModel: DetailsViewModel = viewModel { DetailsViewModel(createSavedStateHandle(), interactor) } + interactor: Interactor = koinInject(), + viewModel: DetailsViewModel = viewModel { DetailsViewModel(createSavedStateHandle(), interactor) } ) { - /*val detailsState by viewModel.detailsState.collectAsStateCommon() + val detailsState by viewModel.detailsState.collectAsStateCommon() DetailsScreenContent( onBackClick = onBackClick, onNavigateToGallery = onNavigateToGallery, detailsState = detailsState, modifier = modifier - )*/ + ) } \ No newline at end of file diff --git a/feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/DetailsViewModel.kt b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/DetailsViewModel.kt similarity index 100% rename from feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/DetailsViewModel.kt rename to feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/DetailsViewModel.kt diff --git a/feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/di/DetailsKoinModule.desktop.kt b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/di/DetailsKoinModule.desktop.kt similarity index 100% rename from feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/di/DetailsKoinModule.desktop.kt rename to feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/di/DetailsKoinModule.desktop.kt diff --git a/feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.desktop.kt b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.desktop.kt similarity index 100% rename from feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.desktop.kt rename to feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.desktop.kt diff --git a/feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.desktop.kt b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.desktop.kt similarity index 100% rename from feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.desktop.kt rename to feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.desktop.kt diff --git a/feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/ui/DetailsRoute.desktop.kt b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsRoute.desktop.kt similarity index 100% rename from feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/ui/DetailsRoute.desktop.kt rename to feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsRoute.desktop.kt diff --git a/feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.desktop.kt b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.desktop.kt similarity index 100% rename from feature/details-impl/src/desktopMain/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.desktop.kt rename to feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.desktop.kt diff --git a/feature/details/build.gradle.kts b/feature/details/build.gradle.kts index 194ed8188..2ad95c61e 100644 --- a/feature/details/build.gradle.kts +++ b/feature/details/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,11 +20,6 @@ kotlin { commonMain.dependencies { api(project(":feature:details-impl")) } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.material) - implementation(compose.material3) - } } compilerOptions { diff --git a/feature/details/src/desktopMain/kotlin/org/michaelbel/movies/details/DetailsNavigation.desktop.kt b/feature/details/src/jvmMain/kotlin/org/michaelbel/movies/details/DetailsNavigation.desktop.kt similarity index 100% rename from feature/details/src/desktopMain/kotlin/org/michaelbel/movies/details/DetailsNavigation.desktop.kt rename to feature/details/src/jvmMain/kotlin/org/michaelbel/movies/details/DetailsNavigation.desktop.kt diff --git a/feature/feed-impl/build.gradle.kts b/feature/feed-impl/build.gradle.kts index c8798ff3d..7590bc5bd 100644 --- a/feature/feed-impl/build.gradle.kts +++ b/feature/feed-impl/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -19,27 +19,13 @@ kotlin { sourceSets { commonMain.dependencies { api(project(":core:ui")) - api(project(":core:common")) api(project(":core:navigation")) api(project(":core:interactor")) api(project(":core:platform-services:interactor")) implementation(project(":core:notifications")) - implementation(libs.bundles.constraintlayout.common) - implementation(compose.foundation) - implementation(compose.runtime) - implementation(compose.material3) - implementation(compose.components.resources) } androidMain.dependencies { - implementation(libs.bundles.paging.common) // fixme ломает navigation - } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.material3) - implementation(compose.runtime) - implementation(libs.koin.compose) + implementation(libs.bundles.paging.common) } } diff --git a/feature/feed-impl/src/iosMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.desktop.kt b/feature/feed-impl/src/iosMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.desktop.kt index 0e2d4ee2d..b7d643894 100644 --- a/feature/feed-impl/src/iosMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.desktop.kt +++ b/feature/feed-impl/src/iosMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.desktop.kt @@ -1,9 +1,11 @@ package org.michaelbel.movies.feed.ui -import androidx.compose.foundation.clickable -import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import org.koin.compose.koinInject +import org.michaelbel.movies.feed.FeedViewModel +import org.michaelbel.movies.ui.ktx.collectAsStateCommon @Composable fun FeedRoute( @@ -13,14 +15,9 @@ fun FeedRoute( onNavigateToSettings: () -> Unit, onNavigateToDetails: (String, Int) -> Unit, modifier: Modifier = Modifier, - //viewModel: FeedViewModel = koinInject() + viewModel: FeedViewModel = koinInject() ) { - Text( - text = "settings", - modifier = Modifier.clickable { onNavigateToSettings() } - ) - - /*val currentFeedView by viewModel.currentFeedView.collectAsStateCommon() + val currentFeedView by viewModel.currentFeedView.collectAsStateCommon() val currentMovieList by viewModel.currentMovieList.collectAsStateCommon() val pagingData by viewModel.pagingDataFlow.collectAsStateCommon() @@ -34,5 +31,5 @@ fun FeedRoute( onNavigateToSettings = onNavigateToSettings, onNavigateToDetails = onNavigateToDetails, modifier = modifier - )*/ + ) } \ No newline at end of file diff --git a/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt b/feature/feed-impl/src/jvmMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt similarity index 100% rename from feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt rename to feature/feed-impl/src/jvmMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt diff --git a/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.desktop.kt b/feature/feed-impl/src/jvmMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.desktop.kt similarity index 100% rename from feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.desktop.kt rename to feature/feed-impl/src/jvmMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.desktop.kt diff --git a/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.desktop.kt b/feature/feed-impl/src/jvmMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.desktop.kt similarity index 100% rename from feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.desktop.kt rename to feature/feed-impl/src/jvmMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.desktop.kt diff --git a/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.desktop.kt b/feature/feed-impl/src/jvmMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.desktop.kt similarity index 100% rename from feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.desktop.kt rename to feature/feed-impl/src/jvmMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.desktop.kt diff --git a/feature/feed/build.gradle.kts b/feature/feed/build.gradle.kts index 46e346b7d..aede5a62e 100644 --- a/feature/feed/build.gradle.kts +++ b/feature/feed/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,11 +20,6 @@ kotlin { commonMain.dependencies { api(project(":feature:feed-impl")) } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.material) - implementation(compose.material3) - } } compilerOptions { diff --git a/feature/feed/src/desktopMain/kotlin/org/michaelbel/movies/feed/FeedNavigation.desktop.kt b/feature/feed/src/jvmMain/kotlin/org/michaelbel/movies/feed/FeedNavigation.desktop.kt similarity index 100% rename from feature/feed/src/desktopMain/kotlin/org/michaelbel/movies/feed/FeedNavigation.desktop.kt rename to feature/feed/src/jvmMain/kotlin/org/michaelbel/movies/feed/FeedNavigation.desktop.kt diff --git a/feature/gallery-impl/build.gradle.kts b/feature/gallery-impl/build.gradle.kts index 9c5d5b18e..8b4e1a2bd 100644 --- a/feature/gallery-impl/build.gradle.kts +++ b/feature/gallery-impl/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,18 +20,8 @@ kotlin { commonMain.dependencies { api(project(":core:ui")) api(project(":core:work")) - api(project(":core:common")) api(project(":core:interactor")) api(project(":core:navigation")) - implementation(libs.bundles.constraintlayout.common) - } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.material3) - implementation(compose.runtime) - implementation(libs.koin.compose) } } diff --git a/feature/gallery-impl/src/iosMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryRoute.ios.kt b/feature/gallery-impl/src/iosMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryRoute.ios.kt index d2b8a38f2..697057f9c 100644 --- a/feature/gallery-impl/src/iosMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryRoute.ios.kt +++ b/feature/gallery-impl/src/iosMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryRoute.ios.kt @@ -4,12 +4,14 @@ import androidx.compose.foundation.clickable import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import org.koin.compose.koinInject +import org.michaelbel.movies.gallery.GalleryViewModel @Composable fun GalleryRoute( onBackClick: () -> Unit, modifier: Modifier = Modifier, - //viewModel: GalleryViewModel = koinInject() + viewModel: GalleryViewModel = koinInject() ) { Text( text = "Gallery", diff --git a/feature/gallery-impl/src/desktopMain/kotlin/org/michaelbel/movies/gallery/GalleryViewModel.kt b/feature/gallery-impl/src/jvmMain/kotlin/org/michaelbel/movies/gallery/GalleryViewModel.kt similarity index 100% rename from feature/gallery-impl/src/desktopMain/kotlin/org/michaelbel/movies/gallery/GalleryViewModel.kt rename to feature/gallery-impl/src/jvmMain/kotlin/org/michaelbel/movies/gallery/GalleryViewModel.kt diff --git a/feature/gallery-impl/src/desktopMain/kotlin/org/michaelbel/movies/gallery/di/GalleryKoinModule.desktop.kt b/feature/gallery-impl/src/jvmMain/kotlin/org/michaelbel/movies/gallery/di/GalleryKoinModule.desktop.kt similarity index 100% rename from feature/gallery-impl/src/desktopMain/kotlin/org/michaelbel/movies/gallery/di/GalleryKoinModule.desktop.kt rename to feature/gallery-impl/src/jvmMain/kotlin/org/michaelbel/movies/gallery/di/GalleryKoinModule.desktop.kt diff --git a/feature/gallery-impl/src/desktopMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryRoute.desktop.kt b/feature/gallery-impl/src/jvmMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryRoute.desktop.kt similarity index 100% rename from feature/gallery-impl/src/desktopMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryRoute.desktop.kt rename to feature/gallery-impl/src/jvmMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryRoute.desktop.kt diff --git a/feature/gallery/build.gradle.kts b/feature/gallery/build.gradle.kts index 49dcaf4a9..92f8d82a9 100644 --- a/feature/gallery/build.gradle.kts +++ b/feature/gallery/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,11 +20,6 @@ kotlin { commonMain.dependencies { api(project(":feature:gallery-impl")) } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.material) - implementation(compose.material3) - } } compilerOptions { diff --git a/feature/gallery/src/desktopMain/kotlin/org/michaelbel/movies/gallery/GalleryNavigation.desktop.kt b/feature/gallery/src/jvmMain/kotlin/org/michaelbel/movies/gallery/GalleryNavigation.desktop.kt similarity index 100% rename from feature/gallery/src/desktopMain/kotlin/org/michaelbel/movies/gallery/GalleryNavigation.desktop.kt rename to feature/gallery/src/jvmMain/kotlin/org/michaelbel/movies/gallery/GalleryNavigation.desktop.kt diff --git a/feature/main-impl/build.gradle.kts b/feature/main-impl/build.gradle.kts index 8556090a2..d61064d12 100644 --- a/feature/main-impl/build.gradle.kts +++ b/feature/main-impl/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -29,10 +29,6 @@ kotlin { androidMain.dependencies { api(project(":feature:debug")) } - val desktopMain by getting - desktopMain.dependencies { - implementation(libs.koin.compose) - } } compilerOptions { diff --git a/feature/main-impl/src/desktopMain/kotlin/org/michaelbel/movies/main/MainContent.desktop.kt b/feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/MainContent.desktop.kt similarity index 100% rename from feature/main-impl/src/desktopMain/kotlin/org/michaelbel/movies/main/MainContent.desktop.kt rename to feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/MainContent.desktop.kt diff --git a/feature/main-impl/src/desktopMain/kotlin/org/michaelbel/movies/main/MainViewModel.kt b/feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/MainViewModel.kt similarity index 100% rename from feature/main-impl/src/desktopMain/kotlin/org/michaelbel/movies/main/MainViewModel.kt rename to feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/MainViewModel.kt diff --git a/feature/main-impl/src/desktopMain/kotlin/org/michaelbel/movies/main/di/MainKoinModule.desktop.kt b/feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/di/MainKoinModule.desktop.kt similarity index 100% rename from feature/main-impl/src/desktopMain/kotlin/org/michaelbel/movies/main/di/MainKoinModule.desktop.kt rename to feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/di/MainKoinModule.desktop.kt diff --git a/feature/search-impl/build.gradle.kts b/feature/search-impl/build.gradle.kts index 52cb6c4e9..a646a2cf0 100644 --- a/feature/search-impl/build.gradle.kts +++ b/feature/search-impl/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,21 +20,11 @@ kotlin { commonMain.dependencies { api(project(":core:navigation")) api(project(":core:ui")) - api(project(":core:common")) api(project(":core:interactor")) implementation(project(":core:notifications")) - implementation(libs.bundles.constraintlayout.common) } androidMain.dependencies { - implementation(libs.bundles.paging.common) // fixme ломает navigation - } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.material3) - implementation(compose.runtime) - implementation(libs.koin.compose) + implementation(libs.bundles.paging.common) } } diff --git a/feature/search-impl/src/iosMain/kotlin/org/michaelbel/movies/search/ui/SearchRoute.ios.kt b/feature/search-impl/src/iosMain/kotlin/org/michaelbel/movies/search/ui/SearchRoute.ios.kt index 5290b3bbb..aa2341dcc 100644 --- a/feature/search-impl/src/iosMain/kotlin/org/michaelbel/movies/search/ui/SearchRoute.ios.kt +++ b/feature/search-impl/src/iosMain/kotlin/org/michaelbel/movies/search/ui/SearchRoute.ios.kt @@ -4,15 +4,17 @@ import androidx.compose.foundation.clickable import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import org.koin.compose.koinInject import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.persistence.database.typealiases.PagingKey +import org.michaelbel.movies.search.SearchViewModel @Composable fun SearchRoute( onBackClick: () -> Unit, onNavigateToDetails: (PagingKey, MovieId) -> Unit, modifier: Modifier = Modifier, - //viewModel: SearchViewModel = koinInject() + viewModel: SearchViewModel = koinInject() ) { Text( text = "Feed", diff --git a/feature/search-impl/src/desktopMain/kotlin/org/michaelbel/movies/search/SearchViewModel.kt b/feature/search-impl/src/jvmMain/kotlin/org/michaelbel/movies/search/SearchViewModel.kt similarity index 100% rename from feature/search-impl/src/desktopMain/kotlin/org/michaelbel/movies/search/SearchViewModel.kt rename to feature/search-impl/src/jvmMain/kotlin/org/michaelbel/movies/search/SearchViewModel.kt diff --git a/feature/search-impl/src/desktopMain/kotlin/org/michaelbel/movies/search/di/SearchKoinModule.desktop.kt b/feature/search-impl/src/jvmMain/kotlin/org/michaelbel/movies/search/di/SearchKoinModule.desktop.kt similarity index 100% rename from feature/search-impl/src/desktopMain/kotlin/org/michaelbel/movies/search/di/SearchKoinModule.desktop.kt rename to feature/search-impl/src/jvmMain/kotlin/org/michaelbel/movies/search/di/SearchKoinModule.desktop.kt diff --git a/feature/search-impl/src/desktopMain/kotlin/org/michaelbel/movies/search/ui/SearchRoute.desktop.kt b/feature/search-impl/src/jvmMain/kotlin/org/michaelbel/movies/search/ui/SearchRoute.desktop.kt similarity index 100% rename from feature/search-impl/src/desktopMain/kotlin/org/michaelbel/movies/search/ui/SearchRoute.desktop.kt rename to feature/search-impl/src/jvmMain/kotlin/org/michaelbel/movies/search/ui/SearchRoute.desktop.kt diff --git a/feature/search/build.gradle.kts b/feature/search/build.gradle.kts index 5a93a4f01..2965ab4e2 100644 --- a/feature/search/build.gradle.kts +++ b/feature/search/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,11 +20,6 @@ kotlin { commonMain.dependencies { api(project(":feature:search-impl")) } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.material) - implementation(compose.material3) - } } compilerOptions { diff --git a/feature/search/src/desktopMain/kotlin/org/michaelbel/movies/search/SearchNavigation.desktop.kt b/feature/search/src/jvmMain/kotlin/org/michaelbel/movies/search/SearchNavigation.desktop.kt similarity index 100% rename from feature/search/src/desktopMain/kotlin/org/michaelbel/movies/search/SearchNavigation.desktop.kt rename to feature/search/src/jvmMain/kotlin/org/michaelbel/movies/search/SearchNavigation.desktop.kt diff --git a/feature/settings-impl/build.gradle.kts b/feature/settings-impl/build.gradle.kts index 9ea8b05bc..ce652622b 100644 --- a/feature/settings-impl/build.gradle.kts +++ b/feature/settings-impl/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,21 +20,9 @@ kotlin { commonMain.dependencies { api(project(":core:navigation")) api(project(":core:ui")) - api(project(":core:common")) api(project(":core:interactor")) api(project(":core:widget")) api(project(":core:platform-services:interactor")) - implementation(compose.components.resources) - implementation(compose.foundation) - implementation(compose.material3) - implementation(compose.runtime) - implementation(libs.bundles.constraintlayout.common) - } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.desktop.currentOs) - implementation(libs.bundles.kotlinx.coroutines.desktop) - implementation(libs.koin.compose) } } diff --git a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.ios.kt b/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.ios.kt index aefac7a48..f6c0dfff9 100644 --- a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.ios.kt +++ b/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.ios.kt @@ -1,21 +1,45 @@ package org.michaelbel.movies.settings.ui -import androidx.compose.foundation.clickable -import androidx.compose.material3.Text +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import org.jetbrains.compose.resources.stringResource +import org.koin.compose.koinInject +import org.michaelbel.movies.common.gender.GrammaticalGender +import org.michaelbel.movies.interactor.entity.AppLanguage +import org.michaelbel.movies.settings.SettingsViewModel +import org.michaelbel.movies.settings.model.SettingsData +import org.michaelbel.movies.settings.model.isAboutFeatureEnabled +import org.michaelbel.movies.settings.model.isAppIconFeatureEnabled +import org.michaelbel.movies.settings.model.isBiometricFeatureEnabled +import org.michaelbel.movies.settings.model.isDynamicColorsFeatureEnabled +import org.michaelbel.movies.settings.model.isFeedViewFeatureEnabled +import org.michaelbel.movies.settings.model.isGenderFeatureEnabled +import org.michaelbel.movies.settings.model.isGithubFeatureEnabled +import org.michaelbel.movies.settings.model.isLanguageFeatureEnabled +import org.michaelbel.movies.settings.model.isMovieListFeatureEnabled +import org.michaelbel.movies.settings.model.isNotificationsFeatureEnabled +import org.michaelbel.movies.settings.model.isReviewAppFeatureEnabled +import org.michaelbel.movies.settings.model.isScreenshotFeatureEnabled +import org.michaelbel.movies.settings.model.isThemeFeatureEnabled +import org.michaelbel.movies.settings.model.isTileFeatureEnabled +import org.michaelbel.movies.settings.model.isUpdateAppFeatureEnabled +import org.michaelbel.movies.settings.model.isWidgetFeatureEnabled +import org.michaelbel.movies.ui.appicon.IconAlias +import org.michaelbel.movies.ui.ktx.collectAsStateCommon +import org.michaelbel.movies.ui.strings.MoviesStrings @Composable fun SettingsRoute( onBackClick: () -> Unit, modifier: Modifier = Modifier, - //viewModel: SettingsViewModel = koinInject() + viewModel: SettingsViewModel = koinInject() ) { - Text( - text = "feed", - modifier = Modifier.clickable { onBackClick() } - ) - /*val currentLanguage = AppLanguage.transform(stringResource(MoviesStrings.language_code)) + val currentLanguage = AppLanguage.transform(stringResource(MoviesStrings.language_code)) val themeData by viewModel.themeData.collectAsStateCommon() val currentFeedView by viewModel.currentFeedView.collectAsStateCommon() val currentMovieList by viewModel.currentMovieList.collectAsStateCommon() @@ -118,5 +142,5 @@ fun SettingsRoute( windowInsets = WindowInsets(0.dp, 0.dp, 0.dp, 0.dp), snackbarHostState = snackbarHostState, modifier = modifier - )*/ + ) } \ No newline at end of file diff --git a/feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/SettingsViewModel.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/SettingsViewModel.kt similarity index 100% rename from feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/SettingsViewModel.kt rename to feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/SettingsViewModel.kt diff --git a/feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/di/SettingsKoinModule.desktop.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/di/SettingsKoinModule.desktop.kt similarity index 100% rename from feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/di/SettingsKoinModule.desktop.kt rename to feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/di/SettingsKoinModule.desktop.kt diff --git a/feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.desktop.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.desktop.kt similarity index 100% rename from feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.desktop.kt rename to feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.desktop.kt diff --git a/feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/model/Features.desktop.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/model/Features.desktop.kt similarity index 100% rename from feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/model/Features.desktop.kt rename to feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/model/Features.desktop.kt diff --git a/feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.desktop.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.desktop.kt similarity index 100% rename from feature/settings-impl/src/desktopMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.desktop.kt rename to feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.desktop.kt diff --git a/feature/settings/build.gradle.kts b/feature/settings/build.gradle.kts index 764acee13..ac8344215 100644 --- a/feature/settings/build.gradle.kts +++ b/feature/settings/build.gradle.kts @@ -11,7 +11,7 @@ plugins { kotlin { androidTarget() - jvm("desktop") + jvm() iosX64() iosArm64() iosSimulatorArm64() @@ -20,11 +20,6 @@ kotlin { commonMain.dependencies { api(project(":feature:settings-impl")) } - val desktopMain by getting - desktopMain.dependencies { - implementation(compose.material) - implementation(compose.material3) - } } compilerOptions { diff --git a/feature/settings/src/desktopMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.desktop.kt b/feature/settings/src/jvmMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.desktop.kt similarity index 100% rename from feature/settings/src/desktopMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.desktop.kt rename to feature/settings/src/jvmMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.desktop.kt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b42179645..0a3f0d9d4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -84,6 +84,7 @@ barista = "4.3.0" kotest = "5.9.1" sqldelight = "2.0.2" koin = "3.6.0-wasm-alpha2" +koin-compose = "1.2.0-Beta4" constraintlayout-compose-multiplatform = "0.4.0" okio = "3.9.0" buildkonfig = "0.15.1" @@ -229,11 +230,8 @@ sqldelight-sqlite-driver = { module = "app.cash.sqldelight:sqlite-driver", versi koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" } koin-androidx-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koin" } koin-androidx-workmanager = { module = "io.insert-koin:koin-androidx-workmanager", version.ref = "koin" } -koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } -koin-core-jvm = { module = "io.insert-koin:koin-core-jvm", version.ref = "koin" } -koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin" } -koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" } -koin-test-junit4 = { module = "io.insert-koin:koin-test-junit4", version.ref = "koin" } +koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin-compose" } +koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel", version.ref = "koin-compose" } constraintlayout-compose-multiplatform = { module = "tech.annexflow.compose:constraintlayout-compose-multiplatform", version.ref = "constraintlayout-compose-multiplatform" } okio = { module = "com.squareup.okio:okio", version.ref = "okio" } napier = { module = "io.github.aakira:napier", version.ref = "napier" } @@ -293,7 +291,8 @@ ktor-common = [ "ktor-serialization-kotlinx-json" ] koin-common = [ - "koin-core" + "koin-compose", + "koin-compose-viewmodel" ] coil-common = [ "coil3-compose", @@ -419,9 +418,6 @@ ktor-android = [ "ktor-client-android" ] koin-android = [ - "koin-android" -] -koin-compose-work-android = [ "koin-android", "koin-androidx-compose", "koin-androidx-workmanager" diff --git a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/mihailbelyj.xcuserdatad/UserInterfaceState.xcuserstate b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/mihailbelyj.xcuserdatad/UserInterfaceState.xcuserstate index 56449aa22..3675cf112 100644 Binary files a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/mihailbelyj.xcuserdatad/UserInterfaceState.xcuserstate and b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/mihailbelyj.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iosAppCompose/build.gradle.kts b/iosAppCompose/build.gradle.kts index 5cc61c13a..d73f9e062 100644 --- a/iosAppCompose/build.gradle.kts +++ b/iosAppCompose/build.gradle.kts @@ -5,19 +5,19 @@ plugins { } kotlin { - iosX64("iosX64") { + iosX64 { binaries.framework { baseName = "iosAppCompose" isStatic = true } } - iosArm64("iosArm64") { + iosArm64 { binaries.framework { baseName = "iosAppCompose" isStatic = true } } - iosSimulatorArm64("iosSimulatorArm64") { + iosSimulatorArm64 { binaries.framework { baseName = "iosAppCompose" isStatic = true @@ -28,39 +28,7 @@ kotlin { commonMain.dependencies { implementation(project(":core:platform-services:inject-ios")) implementation(project(":feature:main-impl")) - implementation(compose.runtime) - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.ui) - implementation(compose.components.resources) - implementation(compose.components.uiToolingPreview) - } - val iosX64Main by getting - iosX64Main.dependencies { - implementation(compose.runtime) - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.ui) - implementation(compose.components.resources) - implementation(compose.components.uiToolingPreview) - } - val iosArm64Main by getting - iosArm64Main.dependencies { - implementation(compose.runtime) - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.ui) - implementation(compose.components.resources) - implementation(compose.components.uiToolingPreview) - } - val iosSimulatorArm64Main by getting - iosSimulatorArm64Main.dependencies { - implementation(compose.runtime) - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.ui) - implementation(compose.components.resources) - implementation(compose.components.uiToolingPreview) } + iosMain.dependencies {} } } \ No newline at end of file diff --git a/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/MainContent.kt b/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/MainContent.kt new file mode 100644 index 000000000..8925f75de --- /dev/null +++ b/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/MainContent.kt @@ -0,0 +1,75 @@ +package org.michaelbel.movies + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.DisposableEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.lifecycle.ViewModelStore +import androidx.lifecycle.ViewModelStoreOwner +import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner +import org.koin.compose.KoinApplication +import org.koin.compose.koinInject +import org.michaelbel.movies.common.ThemeData +import org.michaelbel.movies.di.appKoinModule +import org.michaelbel.movies.main.MainContent +import org.michaelbel.movies.main.MainViewModel +import org.michaelbel.movies.ui.ktx.collectAsStateCommon +import org.michaelbel.movies.ui.theme.MoviesTheme + +@Composable +fun IosMainContent() { + KoinApplication( + application = { + modules(appKoinModule) + } + ) { + val viewModel = koinInject() + val themeData by viewModel.themeData.collectAsStateCommon() + + withViewModelStoreOwner { + MoviesTheme( + themeData = ThemeData( + appTheme = themeData.appTheme, + dynamicColors = false, + paletteKey = themeData.paletteKey, + seedColor = themeData.seedColor + ), + theme = themeData.appTheme, + enableEdgeToEdge = { _,_ -> } + ) { + MainContent() + } + } + } +} + +private class ComposeViewModelStoreOwner: ViewModelStoreOwner { + override val viewModelStore = ViewModelStore() + fun dispose() { viewModelStore.clear() } +} + +@Composable +private fun rememberComposeViewModelStoreOwner(): ViewModelStoreOwner { + val viewModelStoreOwner = remember { ComposeViewModelStoreOwner() } + DisposableEffect(viewModelStoreOwner) { + onDispose { viewModelStoreOwner.dispose() } + } + return viewModelStoreOwner +} + +@Composable +internal fun withViewModelStoreOwner(content: @Composable () -> Unit) { + if (LocalViewModelStoreOwner.current != null) { + // Normal case: use system-provided owner + content() + } else { + // Fallback case: use ViewModelStoreOwner with scope of this composable. + // It's required for Compose Multiplatform for now because it's not providing default value yet. + // Expected to be fixed in Compose Multiplatform 1.7.0 + CompositionLocalProvider( + LocalViewModelStoreOwner provides rememberComposeViewModelStoreOwner(), + content = content + ) + } +} \ No newline at end of file diff --git a/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/main/MainViewController.kt b/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/MainViewController.kt similarity index 77% rename from iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/main/MainViewController.kt rename to iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/MainViewController.kt index 9f305a018..b43ca8d47 100644 --- a/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/main/MainViewController.kt +++ b/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/MainViewController.kt @@ -1,8 +1,9 @@ @file:Suppress("unused", "FunctionName") -package org.michaelbel.movies.main +package org.michaelbel.movies import androidx.compose.ui.window.ComposeUIViewController +import org.michaelbel.movies.IosMainContent import platform.UIKit.UIViewController fun MainViewController(): UIViewController { diff --git a/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt b/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt new file mode 100644 index 000000000..069b810a8 --- /dev/null +++ b/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt @@ -0,0 +1,26 @@ +package org.michaelbel.movies.di + +import org.koin.dsl.module +import org.michaelbel.movies.account.di.accountKoinModule +import org.michaelbel.movies.auth.di.authKoinModule +import org.michaelbel.movies.details.di.detailsKoinModule +import org.michaelbel.movies.feed.di.feedKoinModule +import org.michaelbel.movies.gallery.di.galleryKoinModule +import org.michaelbel.movies.main.di.mainKoinModule +import org.michaelbel.movies.platform.inject.flavorServiceKtorModule +import org.michaelbel.movies.search.di.searchKoinModule +import org.michaelbel.movies.settings.di.settingsKoinModule + +internal val appKoinModule = module { + includes( + flavorServiceKtorModule, + mainKoinModule, + accountKoinModule, + authKoinModule, + detailsKoinModule, + feedKoinModule, + galleryKoinModule, + searchKoinModule, + settingsKoinModule + ) +} \ No newline at end of file diff --git a/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/main/MainContent.kt b/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/main/MainContent.kt deleted file mode 100644 index 8cf820132..000000000 --- a/iosAppCompose/src/iosMain/kotlin/org/michaelbel/movies/main/MainContent.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.michaelbel.movies.main - -import androidx.compose.runtime.Composable -import org.jetbrains.compose.ui.tooling.preview.Preview -import org.michaelbel.movies.common.ThemeData -import org.michaelbel.movies.common.theme.AppTheme -import org.michaelbel.movies.ui.theme.MoviesTheme - -@Composable -@Preview -fun IosMainContent() { - MoviesTheme( - themeData = ThemeData( - appTheme = AppTheme.FollowSystem, - dynamicColors = false, - paletteKey = 0, - seedColor = 0 - ), - theme = AppTheme.FollowSystem, - enableEdgeToEdge = { _,_ -> } - ) { - MainContent() - } -} \ No newline at end of file