Skip to content

Commit

Permalink
iOS app
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Jul 21, 2024
1 parent ce47cdb commit 4a77a80
Show file tree
Hide file tree
Showing 135 changed files with 264 additions and 321 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 1 addition & 5 deletions core/analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ plugins {

kotlin {
androidTarget()
jvm("desktop")
jvm()
iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
commonMain.dependencies {
implementation(project(":core:platform-services:interactor"))
implementation(libs.bundles.koin.common)
}
androidMain.dependencies {
implementation(libs.bundles.koin.android)
}
}

Expand Down
11 changes: 5 additions & 6 deletions core/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
Expand Down
5 changes: 1 addition & 4 deletions core/interactor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {

kotlin {
androidTarget()
jvm("desktop")
jvm()
iosX64()
iosArm64()
iosSimulatorArm64()
Expand All @@ -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)
}
}
Expand Down
5 changes: 2 additions & 3 deletions core/navigation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {

kotlin {
androidTarget()
jvm("desktop")
jvm()
iosX64()
iosArm64()
iosSimulatorArm64()
Expand All @@ -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)
}
}
Expand Down
7 changes: 3 additions & 4 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/notifications/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {

kotlin {
androidTarget()
jvm("desktop")
jvm()
iosX64()
iosArm64()
iosSimulatorArm64()
Expand Down
11 changes: 6 additions & 5 deletions core/persistence/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
}
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,15 @@ package org.michaelbel.movies.persistence.database.di

import org.koin.dsl.module

actual val databaseKoinModule = module {}
actual val databaseKoinModule = module {
//single<AppDatabase> { createRoomDatabase().build() }
}

/*
private fun createRoomDatabase(): RoomDatabase.Builder<AppDatabase> {
val dbFile = NSHomeDirectory() + "/${AppDatabase.DATABASE_NAME}"
return Room.databaseBuilder<AppDatabase>(
name = dbFile,
factory = { AppDatabase::class.instantiateImpl() } // IDE may show error but there is none.
)
}*/
6 changes: 2 additions & 4 deletions core/platform-services/foss/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}

Expand Down
5 changes: 1 addition & 4 deletions core/platform-services/gms/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
5 changes: 1 addition & 4 deletions core/platform-services/hms/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}

Expand Down
7 changes: 1 addition & 6 deletions core/platform-services/inject-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}

Expand Down
4 changes: 1 addition & 3 deletions core/platform-services/inject-desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
2 changes: 0 additions & 2 deletions core/platform-services/inject-ios/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
4 changes: 2 additions & 2 deletions core/platform-services/interactor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}

Expand Down
3 changes: 1 addition & 2 deletions core/repository/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ plugins {

kotlin {
androidTarget()
jvm("desktop")
jvm()
iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
commonMain.dependencies {
api(project(":core:persistence"))
implementation(libs.bundles.kotlinx.coroutines.common)
implementation(libs.bundles.room.paging.common)
}
}
Expand Down
30 changes: 18 additions & 12 deletions core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,39 @@ 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)
api(libs.bundles.palette.android)
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)
}
}

Expand Down
Loading

0 comments on commit 4a77a80

Please sign in to comment.