Skip to content

Commit 66e8cc0

Browse files
committed
update to kotlin 2.0
1 parent fcb1618 commit 66e8cc0

File tree

9 files changed

+49
-38
lines changed

9 files changed

+49
-38
lines changed

build.gradle.kts

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import io.github.gradlenexus.publishplugin.NexusPublishExtension
22

33
plugins {
44
idea
5-
kotlin("multiplatform") version "1.8.20-Beta" apply false
6-
id("com.github.ben-manes.versions") version "0.45.0"
7-
id("org.jetbrains.dokka") version "1.7.20"
8-
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
5+
kotlin("multiplatform") version "2.0.0" apply false
6+
id("com.github.ben-manes.versions") version "0.51.0"
7+
id("org.jetbrains.dokka") version "1.9.20"
8+
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
99
}
1010

1111
val sonatypeApiUser = providers.gradleProperty("sonatypeApiUser")
1212
val sonatypeApiKey = providers.gradleProperty("sonatypeApiKey")
1313
if (sonatypeApiUser.isPresent && sonatypeApiKey.isPresent) {
14-
configure<NexusPublishExtension> {
14+
nexusPublishing {
1515
repositories {
1616
sonatype {
1717
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))

core/build.gradle.kts

+24-15
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,26 @@ plugins {
1515
id("org.jetbrains.dokka")
1616
}
1717

18+
// Stub secrets to let the project sync and build without the publication values set up
19+
ext["signing.keyId"] = null
20+
ext["signing.password"] = null
21+
ext["signing.secretKeyRingFile"] = null
22+
ext["ossrhUsername"] = null
23+
ext["ossrhPassword"] = null
24+
25+
val keyId = providers.gradleProperty("signing.gnupg.keyId")
26+
val password = providers.gradleProperty("signing.gnupg.password")
27+
val secretKey = providers.gradleProperty("signing.gnupg.key")
28+
val sonatypeApiUser = providers.gradleProperty("sonatypeApiUser")
29+
val sonatypeApiKey = providers.gradleProperty("sonatypeApiKey")
30+
if (keyId.isPresent && password.isPresent && secretKey.isPresent) {
31+
ext["signing.keyId"] = keyId
32+
ext["signing.password"] = password
33+
ext["signing.key"] = secretKey
34+
ext["ossrhUsername"] = sonatypeApiUser
35+
ext["ossrhPassword"] = sonatypeApiKey
36+
}
37+
1838
val generatedSourcesPath = file("src/commonMain/gen")
1939

2040
shipshape {
@@ -64,22 +84,11 @@ kotlin {
6484
}
6585
}
6686

67-
// Stub secrets to let the project sync and build without the publication values set up
68-
ext["signing.keyId"] = null
69-
ext["signing.password"] = null
70-
ext["signing.secretKeyRingFile"] = null
71-
7287
val keyId = providers.gradleProperty("signing.gnupg.keyId")
7388
val password = providers.gradleProperty("signing.gnupg.password")
7489
val secretKey = providers.gradleProperty("signing.gnupg.key")
7590

76-
if (keyId.isPresent && password.isPresent && secretKey.isPresent) {
77-
ext["signing.keyId"] = keyId
78-
ext["signing.password"] = password
79-
ext["signing.key"] = secretKey
80-
}
81-
82-
fun getExtraString(name: String) = ext[name]?.toString()
91+
// fun getExtraString(name: String) = ext(name).toString()
8392

8493
signing {
8594
useGpgCmd()
@@ -149,7 +158,7 @@ kotlin {
149158
implementation(kotlin("bom"))
150159
implementation(kotlin("stdlib"))
151160

152-
implementation("org.graalvm.js:js:22.3.0")
161+
implementation("org.graalvm.js:js:23.0.5")
153162
implementation("guru.nidi:graphviz-kotlin:0.18.1")
154163

155164
implementation(kotlin("reflect"))
@@ -162,11 +171,11 @@ kotlin {
162171

163172
// Property-based testing
164173

165-
val ejmlVersion = "0.41.1"
174+
val ejmlVersion = "0.43.1"
166175
implementation("org.ejml:ejml-kotlin:$ejmlVersion")
167176
implementation("org.ejml:ejml-all:$ejmlVersion")
168177

169-
val kotestVersion = "5.5.4"
178+
val kotestVersion = "5.9.1"
170179
implementation("io.kotest:kotest-runner-junit5:$kotestVersion")
171180
implementation("io.kotest:kotest-assertions-core:$kotestVersion")
172181
implementation("io.kotest:kotest-property:$kotestVersion")

core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Bindings.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ data class Bindings<X: SFun<X>> constructor(val fMap: MapFxF<X>) {
8080
(it is MFun<X, *, *> && it !is Mat<X, *, *> && it !is MConst<X, *, *>) ||
8181
(it is Vec<X, *> && it.bindings.allFreeVariables.isNotEmpty()) ||
8282
(it is VFun<X, *> && it !is Vec<X, *> && it !is VConst<X, *>) ||
83-
(it is SFun<X> && it !is Constant)
83+
(it is SFun<X> && it !is Constant<*>)
8484

8585
val complete = allFreeVariables.isEmpty()
8686
val readyToBind = allBoundVariables.isNotEmpty()

core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Vector.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ class VDerivative<X: SFun<X>, E: D1>(override val input: VFun<X, E>, override va
141141
is Vec -> Vec(contents.map { it.d(vrb) })
142142
is MVProd<X, *, *> ->
143143
(left.d(vrb) as MFun<X, E, E>) * right as VFun<X, E> +
144-
(left as MFun<X, E, E> * right.d(vrb))
144+
(left as MFun<X, E, E> * right.d(vrb) as VFun<X, E>)
145145
is VMProd<X, *, *> ->
146146
(left.d(vrb) as VFun<X, E> * right as MFun<X, E, E>) +
147-
(left as VFun<X, E> * right.d(vrb))
147+
(left as VFun<X, E> * right.d(vrb) as MFun<X, E, E>)
148148
is Gradient -> invoke().df() // map { it.d(sVar) }
149149
is VMap -> input.df().map { it * ssMap(mapInput to it).d(vrb) } // Chain rule
150150
is VComposition -> evaluate.df()
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

kaliningraph

samples/build.gradle.kts

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ graal {
1515

1616
dependencies {
1717
implementation(kotlin("stdlib"))
18-
compileOnly("org.jetbrains:annotations:23.1.0")
18+
compileOnly("org.jetbrains:annotations:24.1.0")
1919
implementation(project(":kotlingrad"))
2020

21-
implementation("org.graalvm.js:js:22.3.0")
21+
implementation("org.graalvm.js:js:23.0.5")
2222
implementation("guru.nidi:graphviz-kotlin:0.18.1")
2323
// Graphical libraries
2424
implementation("org.jzy3d:jzy3d-api:1.0.3")
2525

26-
implementation("org.jetbrains.lets-plot:lets-plot-kotlin-jvm:4.2.0")
26+
implementation("org.jetbrains.lets-plot:lets-plot-kotlin-jvm:4.7.3")
27+
implementation("org.jetbrains.lets-plot:platf-awt-jvm:4.3.3")
2728

2829
implementation("org.nield:kotlin-statistics:1.2.1")
2930
}

samples/src/main/kotlin/ai/hypergraph/kotlingrad/samples/LetsPlot.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package ai.hypergraph.kotlingrad.samples
33
import ai.hypergraph.kaliningraph.visualization.show
44

55
import jetbrains.datalore.base.geometry.DoubleVector
6-
import jetbrains.datalore.base.values.Colors
7-
import jetbrains.datalore.plot.PlotSvgExport
6+
import org.jetbrains.letsPlot.awt.plot.PlotSvgExport
87
import org.jetbrains.letsPlot.geom.*
98
import org.jetbrains.letsPlot.*
9+
import org.jetbrains.letsPlot.commons.values.Colors
1010
import org.jetbrains.letsPlot.intern.toSpec
1111
import org.jetbrains.letsPlot.label.ggtitle
12+
import org.jetbrains.letsPlot.themes.theme
1213
import kotlin.math.*
1314

1415
fun main() {

shipshape/build.gradle.kts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
plugins {
22
`java-gradle-plugin`
3-
kotlin("jvm") version "1.8.20-Beta"
4-
id("com.gradle.plugin-publish") version "0.12.0"
3+
kotlin("jvm") version "2.0.0"
4+
id("com.gradle.plugin-publish") version "1.2.1"
55
}
66

7-
pluginBundle {
7+
gradlePlugin {
88
website = "https://github.com/breandan/kotlingrad"
99
vcsUrl = "https://github.com/breandan/kotlingrad"
1010
description = "A shape-safe code generator for Kotlin."
11-
tags = listOf("uri", "types", "codegen", "kotlin")
11+
// tags = listOf("uri", "types", "codegen", "kotlin")
1212

13-
mavenCoordinates {
14-
groupId = "ai.hypergraph"
15-
artifactId = "shipshape"
16-
}
13+
// mavenCoordinates {
14+
// groupId = "ai.hypergraph"
15+
// artifactId = "shipshape"
16+
// }
1717
}
1818

1919
repositories {

0 commit comments

Comments
 (0)