From 48e511ffdf76138b84860150f01a5ed9f62de5f0 Mon Sep 17 00:00:00 2001 From: Timofey Solonin Date: Wed, 11 Oct 2023 12:58:34 +0200 Subject: [PATCH] Update build scripts for 1.9.20 --- build.gradle.kts | 24 ++++++----------------- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 7 +++++++ shared/build.gradle.kts | 25 ++++++++---------------- 4 files changed, 22 insertions(+), 36 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cd03afa..90c8d40 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,22 +1,10 @@ -buildscript { - repositories { - gradlePluginPortal() - google() - mavenCentral() - } - dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21") - 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) + delete(rootProject.layout.buildDirectory) } \ 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 30d588a..e60a8cd 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } kotlin { - android { + androidTarget { compilations.all { kotlinOptions { jvmTarget = "1.8" @@ -23,24 +23,15 @@ kotlin { } sourceSets { - targetHierarchy.default() + commonMain { + + } + androidMain { + + } + iosMain { - val commonMain by getting - val commonTest by getting { - dependencies { - implementation(kotlin("test")) - } } - val androidMain by getting - val androidTest by getting - val iosX64Main by getting - val iosArm64Main by getting - val iosSimulatorArm64Main by getting - val iosMain by getting - val iosX64Test by getting - val iosArm64Test by getting - val iosSimulatorArm64Test by getting - val iosTest by getting } }