diff --git a/build.gradle.kts b/build.gradle.kts index d2310b2..e801967 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,23 +1,10 @@ -buildscript { - repositories { - gradlePluginPortal() - google() - mavenCentral() - } - dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21") - classpath("com.squareup.sqldelight:gradle-plugin:1.5.5") - classpath("com.android.tools.build:gradle:8.0.2") - } -} - -allprojects { - repositories { - google() - mavenCentral() - } +plugins { + kotlin("multiplatform").version("1.9.20-RC").apply(false) + kotlin("android").version("1.9.20-RC").apply(false) + id("com.android.application").version("8.1.2").apply(false) + id("com.android.library").version("8.1.2").apply(false) } tasks.register("clean", Delete::class) { - delete(rootProject.buildDir) -} \ No newline at end of file + delete(rootProject.layout.buildDirectory) +} diff --git a/gradle.properties b/gradle.properties index 7c3632c..9847a82 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,4 @@ kotlin.code.style=official kotlin.mpp.androidSourceSetLayoutVersion=2 #Android -android.useAndroidX=true - -#Sql Delight Version -sqlDelightVersion=1.5.5 +android.useAndroidX=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9459f16..3825322 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip diff --git a/settings.gradle.kts b/settings.gradle.kts index cbd8741..84adf9c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,6 +6,13 @@ pluginManagement { } } +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + } +} + rootProject.name = "KMMApp" include(":androidApp") diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index c051074..0e1543b 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -1,15 +1,15 @@ plugins { kotlin("multiplatform") - kotlin("plugin.serialization") version "1.8.21" + kotlin("plugin.serialization").version("1.9.20-RC") id("com.android.library") - id("com.squareup.sqldelight") + id("com.squareup.sqldelight").version("1.5.5") } group = "com.jetbrains.handson" version = "1.0" kotlin { - android { + androidTarget { compilations.all { kotlinOptions { jvmTarget = "1.8" @@ -27,15 +27,13 @@ kotlin { } } - val ktorVersion = "2.3.1" - val sqlDelightVersion = "1.5.4" + val ktorVersion = "2.3.2" + val sqlDelightVersion = "1.5.5" val coroutinesVersion = "1.7.1" val dateTimeVersion = "0.4.0" sourceSets { - targetHierarchy.default() - - val commonMain by getting { + commonMain { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion") implementation("io.ktor:ktor-client-core:$ktorVersion") @@ -45,32 +43,18 @@ kotlin { implementation("org.jetbrains.kotlinx:kotlinx-datetime:$dateTimeVersion") } } - - val commonTest by getting { - dependencies { - implementation(kotlin("test")) - } - } - val androidMain by getting { + androidMain { dependencies { implementation("io.ktor:ktor-client-android:$ktorVersion") implementation("com.squareup.sqldelight:android-driver:$sqlDelightVersion") } } - val androidUnitTest by getting - val iosX64Main by getting - val iosArm64Main by getting - val iosSimulatorArm64Main by getting - val iosMain by getting { + iosMain { dependencies { implementation("io.ktor:ktor-client-darwin:$ktorVersion") implementation("com.squareup.sqldelight:native-driver:$sqlDelightVersion") } } - val iosX64Test by getting - val iosArm64Test by getting - val iosSimulatorArm64Test by getting - val iosTest by getting } } @@ -91,4 +75,4 @@ sqldelight { database("AppDatabase") { packageName = "com.jetbrains.handson.kmm.shared.cache" } -} \ No newline at end of file +}