Skip to content

Commit 53ea704

Browse files
committed
Finishing migration to 1.4.20-M1
1 parent 0a71c71 commit 53ea704

File tree

8 files changed

+38
-10
lines changed

8 files changed

+38
-10
lines changed

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ plugins {
22
id("ru.mipt.npm.project")
33
}
44

5-
val kmathVersion by extra("0.2.0-dev-1")
5+
val kmathVersion by extra("0.2.0-dev-2")
66
val bintrayRepo by extra("kscience")
77
val githubProject by extra("kmath")
88

99
allprojects {
1010
repositories {
1111
jcenter()
12+
maven("https://dl.bintray.com/kotlin/kotlin-eap")
1213
maven("https://dl.bintray.com/kotlin/kotlinx")
1314
maven("https://dl.bintray.com/hotkeytlt/maven")
1415
}

docs/templates/ARTIFACT-TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
>
1111
> ```gradle
1212
> repositories {
13+
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
1314
> maven { url 'https://dl.bintray.com/mipt-npm/kscience' }
1415
> maven { url 'https://dl.bintray.com/mipt-npm/dev' }
1516
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
17+
1618
> }
1719
>
1820
> dependencies {
@@ -23,6 +25,7 @@
2325
>
2426
> ```kotlin
2527
> repositories {
28+
> maven("https://dl.bintray.com/kotlin/kotlin-eap")
2629
> maven("https://dl.bintray.com/mipt-npm/kscience")
2730
> maven("https://dl.bintray.com/mipt-npm/dev")
2831
> maven("https://dl.bintray.com/hotkeytlt/maven")

examples/build.gradle.kts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33
plugins {
44
java
55
kotlin("jvm")
6-
kotlin("plugin.allopen") version "1.4.20-dev-3898-14"
7-
id("kotlinx.benchmark") version "0.2.0-dev-20"
6+
kotlin("plugin.allopen")
7+
id("kotlinx.benchmark")
88
}
99

1010
allOpen.annotation("org.openjdk.jmh.annotations.State")
@@ -26,17 +26,16 @@ dependencies {
2626
implementation(project(":kmath-prob"))
2727
implementation(project(":kmath-viktor"))
2828
implementation(project(":kmath-dimensions"))
29-
implementation("org.jetbrains.kotlinx:kotlinx-io-jvm:0.2.0-npm-dev-6")
29+
implementation("org.jetbrains.kotlinx:kotlinx-io:0.2.0-npm-dev-11")
3030
implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime:0.2.0-dev-20")
3131
"benchmarksCompile"(sourceSets.main.get().output + sourceSets.main.get().compileClasspath) //sourceSets.main.output + sourceSets.main.runtimeClasspath
3232
}
3333

3434
// Configure benchmark
3535
benchmark {
3636
// Setup configurations
37-
targets
38-
// This one matches sourceSet name above
39-
.register("benchmarks")
37+
targets.register("benchmarks")
38+
// This one matches sourceSet name above
4039

4140
configurations.register("fast") {
4241
warmups = 5 // number of warmup iterations

kmath-dimensions/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
plugins { id("ru.mipt.npm.mpp") }
1+
plugins {
2+
id("ru.mipt.npm.mpp")
3+
id("ru.mipt.npm.native")
4+
}
25

36
description = "A proof of concept module for adding type-safe dimensions to structures"
47

kmath-dimensions/src/jsMain/kotlin/kscience/kmath/dimensions/dim.kt renamed to kmath-dimensions/src/jsMain/kotlin/kscience/kmath/dimensions/dimJs.kt

File renamed without changes.

kmath-dimensions/src/jvmMain/kotlin/kscience/kmath/dimensions/dim.kt renamed to kmath-dimensions/src/jvmMain/kotlin/kscience/kmath/dimensions/dimJvm.kt

File renamed without changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package kscience.kmath.dimensions
2+
3+
import kotlin.native.concurrent.ThreadLocal
4+
import kotlin.reflect.KClass
5+
6+
@ThreadLocal
7+
private val dimensionMap: MutableMap<UInt, Dimension> = hashMapOf(1u to D1, 2u to D2, 3u to D3)
8+
9+
@Suppress("UNCHECKED_CAST")
10+
public actual fun <D : Dimension> Dimension.Companion.resolve(type: KClass<D>): D = dimensionMap
11+
.entries
12+
.map(MutableMap.MutableEntry<UInt, Dimension>::value)
13+
.find { it::class == type } as? D
14+
?: error("Can't resolve dimension $type")
15+
16+
public actual fun Dimension.Companion.of(dim: UInt): Dimension = dimensionMap.getOrPut(dim) {
17+
object : Dimension {
18+
override val dim: UInt get() = dim
19+
}
20+
}

settings.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ pluginManagement {
1010
maven("https://dl.bintray.com/kotlin/kotlin-dev/")
1111
}
1212

13-
val toolsVersion = "0.6.1"
13+
val toolsVersion = "0.6.1-dev-1.4.20-M1"
14+
val kotlinVersion = "1.4.20-M1"
1415

1516
plugins {
1617
id("kotlinx.benchmark") version "0.2.0-dev-20"
1718
id("ru.mipt.npm.project") version toolsVersion
1819
id("ru.mipt.npm.mpp") version toolsVersion
1920
id("ru.mipt.npm.jvm") version toolsVersion
2021
id("ru.mipt.npm.publish") version toolsVersion
21-
kotlin("plugin.allopen")
22+
kotlin("jvm") version kotlinVersion
23+
kotlin("plugin.allopen") version kotlinVersion
2224
}
2325
}
2426

0 commit comments

Comments
 (0)