diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index a910eca..d5d977e 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -20,9 +20,9 @@ android { @OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class) kotlin { - targetHierarchy.default() + applyDefaultHierarchyTemplate() - android() + androidTarget() // region iOS configuration @@ -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")) } } } diff --git a/shared/data/build.gradle.kts b/shared/data/build.gradle.kts index b5d484d..0581f83 100644 --- a/shared/data/build.gradle.kts +++ b/shared/data/build.gradle.kts @@ -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()) } } } diff --git a/shared/domain/build.gradle.kts b/shared/domain/build.gradle.kts index 403da80..91c7550 100644 --- a/shared/domain/build.gradle.kts +++ b/shared/domain/build.gradle.kts @@ -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()) } } }