From fc6916a5d5bab4f5e84f8da51c61534d5423ed75 Mon Sep 17 00:00:00 2001 From: sstone Date: Tue, 12 Dec 2023 16:37:41 +0100 Subject: [PATCH] Use kotlin 1.9 --- build.gradle.kts | 24 +++++++++++++++---- .../kotlin/fr/acinq/bitcoin/crypto/Pbkdf2.kt | 1 - 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9eba497c..09c813ad 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,8 +4,8 @@ import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeHostTest import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest plugins { - kotlin("multiplatform") version "1.8.21" - id("org.jetbrains.dokka") version "1.8.10" + kotlin("multiplatform") version "1.9.21" + id("org.jetbrains.dokka") version "1.9.10" `maven-publish` } @@ -30,14 +30,22 @@ kotlin { } } - linuxX64("linux") + linuxX64() - ios { + iosX64 { + compilations["main"].cinterops.create("CoreCrypto") + } + + iosArm64 { + compilations["main"].cinterops.create("CoreCrypto") + } + + iosSimulatorArm64 { compilations["main"].cinterops.create("CoreCrypto") } sourceSets { - val secp256k1KmpVersion = "0.11.0" + val secp256k1KmpVersion = "0.13.0-SNAPSHOT" val commonMain by getting { dependencies { @@ -76,12 +84,18 @@ kotlin { compilations.all { kotlinOptions { allWarningsAsErrors = true + // We use expect/actual for classes (see Chacha20Poly1305CipherFunctions). This feature is in beta and raises a warning. + // See https://youtrack.jetbrains.com/issue/KT-61573 + kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes" } } } } configurations.forEach { + // do not cache changing (i.e. SNAPSHOT) dependencies + it.resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) + if (it.name.contains("testCompileClasspath")) { it.attributes.attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage::class.java, "java-runtime")) } diff --git a/src/commonMain/kotlin/fr/acinq/bitcoin/crypto/Pbkdf2.kt b/src/commonMain/kotlin/fr/acinq/bitcoin/crypto/Pbkdf2.kt index 79500e8a..7453128f 100644 --- a/src/commonMain/kotlin/fr/acinq/bitcoin/crypto/Pbkdf2.kt +++ b/src/commonMain/kotlin/fr/acinq/bitcoin/crypto/Pbkdf2.kt @@ -21,7 +21,6 @@ import kotlin.jvm.JvmStatic public expect object Pbkdf2 { - @JvmStatic public fun withHmacSha512(password: ByteArray, salt: ByteArray, count: Int, dkLen: Int): ByteArray }