From c585c59552e895432b13105532ca00e8186f820b Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 4 Jun 2024 10:31:42 +0300 Subject: [PATCH] 2.0.0 --- benchmarks/build.gradle.kts | 19 ++++++------------- buildSrc/build.gradle.kts | 8 +++----- gradle.properties | 2 +- .../kotlin/space/kscience/kmath/nd/ShapeND.kt | 4 +--- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/benchmarks/build.gradle.kts b/benchmarks/build.gradle.kts index 4894cd265..020ef745f 100644 --- a/benchmarks/build.gradle.kts +++ b/benchmarks/build.gradle.kts @@ -1,6 +1,5 @@ @file:Suppress("UNUSED_VARIABLE") -import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile import space.kscience.kmath.benchmarks.addBenchmarkProperties plugins { @@ -152,18 +151,12 @@ benchmark { } } -kotlin.sourceSets.all { - with(languageSettings) { - optIn("kotlin.contracts.ExperimentalContracts") - optIn("kotlin.ExperimentalUnsignedTypes") - optIn("space.kscience.kmath.UnstableKMathAPI") - } -} - -tasks.withType { - kotlinOptions { - jvmTarget = "11" - freeCompilerArgs = freeCompilerArgs + "-Xjvm-default=all" + "-Xlambdas=indy" +kotlin { + jvmToolchain(11) + compilerOptions { + optIn.addAll( + "space.kscience.kmath.UnstableKMathAPI" + ) } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index c0f9d9631..beb2af7f6 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -26,10 +26,8 @@ dependencies { } kotlin { - jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(11)) - } - sourceSets.all { - languageSettings.optIn("kotlin.OptIn") + jvmToolchain(11) + compilerOptions { + optIn.add("kotlin.OptIn") } } diff --git a/gradle.properties b/gradle.properties index 9a76404a9..2b3b0c9ce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,6 +10,6 @@ org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.workers.max=4 -toolsVersion=0.15.2-kotlin-2.0.0-RC2 +toolsVersion=0.15.4-kotlin-2.0.0 #kotlin.experimental.tryK2=true #kscience.wasm.disabled=true \ No newline at end of file diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/ShapeND.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/ShapeND.kt index d5cdc6286..3a99aef83 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/ShapeND.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/ShapeND.kt @@ -6,13 +6,11 @@ package space.kscience.kmath.nd import space.kscience.kmath.UnsafeKMathAPI -import kotlin.jvm.JvmInline /** * A read-only ND shape */ -@JvmInline -public value class ShapeND(@PublishedApi internal val array: IntArray) { +public class ShapeND(@PublishedApi internal val array: IntArray) { public val size: Int get() = array.size public operator fun get(index: Int): Int = array[index] override fun toString(): String = array.contentToString()