Skip to content

Commit

Permalink
Updates Gradle config after update to Kotlin 1.9.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Tweener committed Nov 9, 2023
1 parent f29f15d commit 4a0e397
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 89 deletions.
19 changes: 8 additions & 11 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ android {

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class)
kotlin {
targetHierarchy.default()
applyDefaultHierarchyTemplate()

android()
androidTarget()

// region iOS configuration

Expand Down Expand Up @@ -52,16 +52,13 @@ kotlin {
// endregion iOS configuration

sourceSets {
val commonMain by getting {
dependencies {
api(project(":shared:data"))
api(project(":shared:domain"))
}
commonMain.dependencies {
api(project(":shared:data"))
api(project(":shared:domain"))
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}

commonTest.dependencies {
implementation(kotlin("test"))
}
}
}
77 changes: 30 additions & 47 deletions shared/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,76 +18,59 @@ android {
}

kotlin {
android()
androidTarget()

iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
val commonMain by getting {
dependencies {
implementation(project(":shared:domain"))
commonMain.dependencies {
implementation(project(":shared:domain"))

// Kotlin
implementation(Dependencies.Libraries.Coroutines.core)
implementation(Dependencies.Libraries.kotlinXDatetime)
// Kotlin
implementation(Dependencies.Libraries.Coroutines.core)
implementation(Dependencies.Libraries.kotlinXDatetime)

// DI
implementation(Dependencies.Libraries.Kodein.core)
// DI
implementation(Dependencies.Libraries.Kodein.core)

// Ktor
implementation(Dependencies.Libraries.Ktor.Client.core)
implementation(Dependencies.Libraries.Ktor.Client.auth)
implementation(Dependencies.Libraries.Ktor.Client.contentNegotiation)
implementation(Dependencies.Libraries.Ktor.Client.logging)
implementation(Dependencies.Libraries.Ktor.serializationJson)

// Napier
implementation(Dependencies.Libraries.napier)
}
// Ktor
implementation(Dependencies.Libraries.Ktor.Client.core)
implementation(Dependencies.Libraries.Ktor.Client.auth)
implementation(Dependencies.Libraries.Ktor.Client.contentNegotiation)
implementation(Dependencies.Libraries.Ktor.Client.logging)
implementation(Dependencies.Libraries.Ktor.serializationJson)

// Napier
implementation(Dependencies.Libraries.napier)
}

val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
commonTest.dependencies {
implementation(kotlin("test"))
}

val androidMain by getting {
dependencies {
// Ktor
implementation(Dependencies.Libraries.Ktor.Client.Android.okhttp)
androidMain.dependencies {
// Ktor
implementation(Dependencies.Libraries.Ktor.Client.Android.okhttp)

// LoggingInterceptor: An OkHttp interceptor for logging network requests and responses
implementation(Dependencies.Libraries.Android.loggingInterceptor) {
exclude(group = "org.json", module = "json")
}
// LoggingInterceptor: An OkHttp interceptor for logging network requests and responses
implementation(Dependencies.Libraries.Android.loggingInterceptor) {
exclude(group = "org.json", module = "json")
}
}

val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
iosMain {
dependsOn(commonMain.get())

dependencies {
// Ktor
implementation(Dependencies.Libraries.Ktor.Client.iOS.client)
}
}
val iosX64Test by getting
val iosArm64Test by getting
val iosSimulatorArm64Test by getting
val iosTest by creating {
dependsOn(commonTest)
iosX64Test.dependsOn(this)
iosArm64Test.dependsOn(this)
iosSimulatorArm64Test.dependsOn(this)

iosTest {
dependsOn(commonTest.get())
}
}
}
47 changes: 16 additions & 31 deletions shared/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,40 @@ android {
}

kotlin {
android()
androidTarget()

iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
val commonMain by getting {
dependencies {
// Kotlin
implementation(Dependencies.Libraries.Coroutines.core)
implementation(Dependencies.Libraries.kotlinXDatetime)
commonMain.dependencies {
// Kotlin
implementation(Dependencies.Libraries.Coroutines.core)
implementation(Dependencies.Libraries.kotlinXDatetime)

// DI
implementation(Dependencies.Libraries.Kodein.core)
// DI
implementation(Dependencies.Libraries.Kodein.core)

// Napier
implementation(Dependencies.Libraries.napier)
}
// Napier
implementation(Dependencies.Libraries.napier)
}

val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
commonTest.dependencies {
implementation(kotlin("test"))
}

val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
iosMain {
dependsOn(commonMain.get())

dependencies {
// Ktor
implementation(Dependencies.Libraries.Ktor.Client.iOS.client)
}
}
val iosX64Test by getting
val iosArm64Test by getting
val iosSimulatorArm64Test by getting
val iosTest by creating {
dependsOn(commonTest)
iosX64Test.dependsOn(this)
iosArm64Test.dependsOn(this)
iosSimulatorArm64Test.dependsOn(this)

iosTest {
dependsOn(commonTest.get())
}
}
}

0 comments on commit 4a0e397

Please sign in to comment.