diff --git a/build.gradle.kts b/build.gradle.kts index 0c49b99b..61465019 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,16 +2,16 @@ import io.github.gradlenexus.publishplugin.NexusPublishExtension plugins { idea - kotlin("multiplatform") version "1.8.20-Beta" apply false - id("com.github.ben-manes.versions") version "0.45.0" - id("org.jetbrains.dokka") version "1.7.20" - id("io.github.gradle-nexus.publish-plugin") version "1.1.0" + kotlin("multiplatform") version "2.0.0" apply false + id("com.github.ben-manes.versions") version "0.51.0" + id("org.jetbrains.dokka") version "1.9.20" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" } val sonatypeApiUser = providers.gradleProperty("sonatypeApiUser") val sonatypeApiKey = providers.gradleProperty("sonatypeApiKey") if (sonatypeApiUser.isPresent && sonatypeApiKey.isPresent) { - configure { + nexusPublishing { repositories { sonatype { nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 2b9fed8f..ef5de5f4 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -15,6 +15,26 @@ plugins { id("org.jetbrains.dokka") } +// Stub secrets to let the project sync and build without the publication values set up +ext["signing.keyId"] = null +ext["signing.password"] = null +ext["signing.secretKeyRingFile"] = null +ext["ossrhUsername"] = null +ext["ossrhPassword"] = null + +val keyId = providers.gradleProperty("signing.gnupg.keyId") +val password = providers.gradleProperty("signing.gnupg.password") +val secretKey = providers.gradleProperty("signing.gnupg.key") +val sonatypeApiUser = providers.gradleProperty("sonatypeApiUser") +val sonatypeApiKey = providers.gradleProperty("sonatypeApiKey") +if (keyId.isPresent && password.isPresent && secretKey.isPresent) { + ext["signing.keyId"] = keyId + ext["signing.password"] = password + ext["signing.key"] = secretKey + ext["ossrhUsername"] = sonatypeApiUser + ext["ossrhPassword"] = sonatypeApiKey +} + val generatedSourcesPath = file("src/commonMain/gen") shipshape { @@ -64,22 +84,11 @@ kotlin { } } - // Stub secrets to let the project sync and build without the publication values set up - ext["signing.keyId"] = null - ext["signing.password"] = null - ext["signing.secretKeyRingFile"] = null - val keyId = providers.gradleProperty("signing.gnupg.keyId") val password = providers.gradleProperty("signing.gnupg.password") val secretKey = providers.gradleProperty("signing.gnupg.key") - if (keyId.isPresent && password.isPresent && secretKey.isPresent) { - ext["signing.keyId"] = keyId - ext["signing.password"] = password - ext["signing.key"] = secretKey - } - - fun getExtraString(name: String) = ext[name]?.toString() +// fun getExtraString(name: String) = ext(name).toString() signing { useGpgCmd() @@ -149,7 +158,7 @@ kotlin { implementation(kotlin("bom")) implementation(kotlin("stdlib")) - implementation("org.graalvm.js:js:22.3.0") + implementation("org.graalvm.js:js:23.0.5") implementation("guru.nidi:graphviz-kotlin:0.18.1") implementation(kotlin("reflect")) @@ -162,11 +171,11 @@ kotlin { // Property-based testing - val ejmlVersion = "0.41.1" + val ejmlVersion = "0.43.1" implementation("org.ejml:ejml-kotlin:$ejmlVersion") implementation("org.ejml:ejml-all:$ejmlVersion") - val kotestVersion = "5.5.4" + val kotestVersion = "5.9.1" implementation("io.kotest:kotest-runner-junit5:$kotestVersion") implementation("io.kotest:kotest-assertions-core:$kotestVersion") implementation("io.kotest:kotest-property:$kotestVersion") diff --git a/core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Bindings.kt b/core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Bindings.kt index 6f17ec35..d80a57ff 100644 --- a/core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Bindings.kt +++ b/core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Bindings.kt @@ -80,7 +80,7 @@ data class Bindings> constructor(val fMap: MapFxF) { (it is MFun && it !is Mat && it !is MConst) || (it is Vec && it.bindings.allFreeVariables.isNotEmpty()) || (it is VFun && it !is Vec && it !is VConst) || - (it is SFun && it !is Constant) + (it is SFun && it !is Constant<*>) val complete = allFreeVariables.isEmpty() val readyToBind = allBoundVariables.isNotEmpty() diff --git a/core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Vector.kt b/core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Vector.kt index bcdfb266..32c2efe0 100644 --- a/core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Vector.kt +++ b/core/src/commonMain/kotlin/ai/hypergraph/kotlingrad/api/Vector.kt @@ -141,10 +141,10 @@ class VDerivative, E: D1>(override val input: VFun, override va is Vec -> Vec(contents.map { it.d(vrb) }) is MVProd -> (left.d(vrb) as MFun) * right as VFun + - (left as MFun * right.d(vrb)) + (left as MFun * right.d(vrb) as VFun) is VMProd -> (left.d(vrb) as VFun * right as MFun) + - (left as VFun * right.d(vrb)) + (left as VFun * right.d(vrb) as MFun) is Gradient -> invoke().df() // map { it.d(sVar) } is VMap -> input.df().map { it * ssMap(mapInput to it).d(vrb) } // Chain rule is VComposition -> evaluate.df() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 070cb702..19cfad96 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/kaliningraph b/kaliningraph index 5af397b0..46f3ade3 160000 --- a/kaliningraph +++ b/kaliningraph @@ -1 +1 @@ -Subproject commit 5af397b018ea55b783871883468d609ecef7e87c +Subproject commit 46f3ade37fe223311c93aea30d4c794f38037176 diff --git a/samples/build.gradle.kts b/samples/build.gradle.kts index 520c58d3..d5710e75 100644 --- a/samples/build.gradle.kts +++ b/samples/build.gradle.kts @@ -15,15 +15,16 @@ graal { dependencies { implementation(kotlin("stdlib")) - compileOnly("org.jetbrains:annotations:23.1.0") + compileOnly("org.jetbrains:annotations:24.1.0") implementation(project(":kotlingrad")) - implementation("org.graalvm.js:js:22.3.0") + implementation("org.graalvm.js:js:23.0.5") implementation("guru.nidi:graphviz-kotlin:0.18.1") // Graphical libraries implementation("org.jzy3d:jzy3d-api:1.0.3") - implementation("org.jetbrains.lets-plot:lets-plot-kotlin-jvm:4.2.0") + implementation("org.jetbrains.lets-plot:lets-plot-kotlin-jvm:4.7.3") + implementation("org.jetbrains.lets-plot:platf-awt-jvm:4.3.3") implementation("org.nield:kotlin-statistics:1.2.1") } diff --git a/samples/src/main/kotlin/ai/hypergraph/kotlingrad/samples/LetsPlot.kt b/samples/src/main/kotlin/ai/hypergraph/kotlingrad/samples/LetsPlot.kt index 386f9420..280d355b 100644 --- a/samples/src/main/kotlin/ai/hypergraph/kotlingrad/samples/LetsPlot.kt +++ b/samples/src/main/kotlin/ai/hypergraph/kotlingrad/samples/LetsPlot.kt @@ -3,12 +3,13 @@ package ai.hypergraph.kotlingrad.samples import ai.hypergraph.kaliningraph.visualization.show import jetbrains.datalore.base.geometry.DoubleVector -import jetbrains.datalore.base.values.Colors -import jetbrains.datalore.plot.PlotSvgExport +import org.jetbrains.letsPlot.awt.plot.PlotSvgExport import org.jetbrains.letsPlot.geom.* import org.jetbrains.letsPlot.* +import org.jetbrains.letsPlot.commons.values.Colors import org.jetbrains.letsPlot.intern.toSpec import org.jetbrains.letsPlot.label.ggtitle +import org.jetbrains.letsPlot.themes.theme import kotlin.math.* fun main() { diff --git a/shipshape/build.gradle.kts b/shipshape/build.gradle.kts index e42368f1..78291705 100644 --- a/shipshape/build.gradle.kts +++ b/shipshape/build.gradle.kts @@ -1,19 +1,19 @@ plugins { `java-gradle-plugin` - kotlin("jvm") version "1.8.20-Beta" - id("com.gradle.plugin-publish") version "0.12.0" + kotlin("jvm") version "2.0.0" + id("com.gradle.plugin-publish") version "1.2.1" } -pluginBundle { +gradlePlugin { website = "https://github.com/breandan/kotlingrad" vcsUrl = "https://github.com/breandan/kotlingrad" description = "A shape-safe code generator for Kotlin." - tags = listOf("uri", "types", "codegen", "kotlin") +// tags = listOf("uri", "types", "codegen", "kotlin") - mavenCoordinates { - groupId = "ai.hypergraph" - artifactId = "shipshape" - } +// mavenCoordinates { +// groupId = "ai.hypergraph" +// artifactId = "shipshape" +// } } repositories {