Skip to content

Commit

Permalink
Update Kotlin to 1.9.20 and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedre committed Nov 13, 2023
1 parent f6238ce commit d33e2b2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 456 deletions.
45 changes: 19 additions & 26 deletions adhan/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension

plugins {
kotlin("multiplatform")
kotlin("plugin.serialization") version "1.8.21"
kotlin("plugin.serialization") version "1.9.20"
id("maven-publish")
id("signing")
}
Expand All @@ -26,31 +28,34 @@ kotlin {
}

linuxX64()
linuxArm64()
mingwX64()

ios()
iosX64()
iosArm64()
iosSimulatorArm64()

macosArm64()
macosX64()

watchos()
watchosX64()
watchosArm64()
watchosSimulatorArm64()

sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
}
}

val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
api("com.squareup.okio:okio:3.3.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0")
api("com.squareup.okio:okio:3.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
}
}

Expand All @@ -65,24 +70,10 @@ kotlin {
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
implementation("com.squareup.okio:okio-nodefilesystem:3.3.0")
implementation("com.squareup.okio:okio-nodefilesystem:3.6.0")
implementation(npm("@js-joda/timezone", "2.3.0"))
}
}

val appleTest by creating { dependsOn(commonTest) }
val iosTest by getting { dependsOn(appleTest) }
val watchosTest by getting { dependsOn(appleTest) }

sourceSets["macosArm64Test"].dependsOn(appleTest)
sourceSets["macosX64Test"].dependsOn(appleTest)
sourceSets["iosSimulatorArm64Test"].dependsOn(appleTest)
sourceSets["watchosSimulatorArm64Test"].dependsOn(appleTest)

val nativeTest by creating { dependsOn(commonTest) }

sourceSets["linuxX64Test"].dependsOn(nativeTest)
sourceSets["mingwX64Test"].dependsOn(nativeTest)
}

// set an environment variable and read it in the test
Expand Down Expand Up @@ -188,12 +179,14 @@ publishing {
}
}

// auto replace yarn.lock
rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin::class.java) {
rootProject.the<YarnRootExtension>().yarnLockMismatchReport =
YarnLockMismatchReport.WARNING
rootProject.the<YarnRootExtension>().yarnLockAutoReplace = true
}

// Signing artifacts. Signing.* extra properties values will be used
signing {
sign(publishing.publications)
}

// TODO: remove after https://youtrack.jetbrains.com/issue/KT-46466 is fixed
project.tasks.withType(AbstractPublishToMaven::class.java).configureEach {
dependsOn(project.tasks.withType(Sign::class.java))
}
10 changes: 0 additions & 10 deletions adhan/src/appleTest/kotlin/com/batoulapps/adhan2/TestUtil.kt

This file was deleted.

2 changes: 2 additions & 0 deletions adhan/src/nativeTest/kotlin/com/batoulapps/adhan2/TestUtil.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.batoulapps.adhan2

import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.toKString
import okio.FileSystem
import platform.posix.getenv

@OptIn(ExperimentalForeignApi::class)
actual class TestUtil actual constructor() {
actual fun fileSystem(): FileSystem = FileSystem.SYSTEM
actual fun environmentVariable(name: String): String? = getenv(name)?.toKString()
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit d33e2b2

Please sign in to comment.