Skip to content

Commit c2deb05

Browse files
committed
chore: dep updates
1 parent c0cada5 commit c2deb05

File tree

8 files changed

+63
-15
lines changed

8 files changed

+63
-15
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122

123123
- name: 🕸 Deploy Wasm, Js & Compose webapp to Github Pages
124124
if: steps.gradle-build.outcome == 'success' && runner.os == 'Linux'
125-
uses: JamesIves/[email protected].1
125+
uses: JamesIves/[email protected].2
126126
with:
127127
branch: gh-pages
128128
folder: backend/jvm/build/resources/main/app
@@ -132,7 +132,7 @@ jobs:
132132

133133
- name: 📡 Publish documentation to Github Pages
134134
if: steps.gradle-build.outcome == 'success' && runner.os == 'Linux'
135-
uses: JamesIves/[email protected].1
135+
uses: JamesIves/[email protected].2
136136
with:
137137
branch: gh-pages
138138
folder: build/dokka/html
@@ -142,7 +142,7 @@ jobs:
142142

143143
- name: 🏖️ Publish coverage report to Github Pages
144144
if: steps.gradle-build.outcome == 'success' && runner.os == 'Linux'
145-
uses: JamesIves/[email protected].1
145+
uses: JamesIves/[email protected].2
146146
with:
147147
branch: gh-pages
148148
folder: build/reports/kover/html
@@ -152,7 +152,7 @@ jobs:
152152

153153
- name: 🧪️ Publish test report to Github Pages
154154
if: steps.gradle-build.outcome == 'success' && runner.os == 'Linux'
155-
uses: JamesIves/[email protected].1
155+
uses: JamesIves/[email protected].2
156156
with:
157157
branch: gh-pages
158158
folder: build/reports/allTests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ reports
1717
hs_err_pid*
1818
classes.lst
1919
*.jsa
20+
*.aot*
2021
jre/
2122

2223
# Kotlin

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,21 @@ $ ./gradlew :backend:jvm:run
132132
# Training Run
133133
$ java --enable-preview \
134134
-XX:+UnlockExperimentalVMOptions \
135+
-XX:+UseCompactObjectHeaders \
135136
-XX:AOTMode=record -XX:AOTConfiguration=app.aotconf \
136137
-jar backend/jvm/build/libs/jvm-all.jar
137138

138139
# Create AOT archive
139140
$ java --enable-preview \
140141
-XX:+UnlockExperimentalVMOptions \
142+
-XX:+UseCompactObjectHeaders \
141143
-XX:AOTMode=create -XX:AOTConfiguration=app.aotconf -XX:AOTCache=app.aot \
142144
-jar backend/jvm/build/libs/jvm-all.jar
143145

144146
# Run with AOT
145147
$ java --enable-preview \
146148
-XX:+UnlockExperimentalVMOptions \
149+
-XX:+UseCompactObjectHeaders \
147150
-XX:AOTCache=app.aot \
148151
-jar backend/jvm/build/libs/jvm-all.jar
149152
```

backend/native/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ kotlin {
5353
api(libs.kaml)
5454
api(libs.kmp.appdirs)
5555
api(libs.kfswatch)
56+
api(libs.chasm)
5657
// api(libs.arrow.suspendapp.ktor)
5758
}
5859
}

backend/native/src/nativeMain/kotlin/Main.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import kotlin.reflect.typeOf
66
import kotlin.time.Duration
77
import kotlinx.coroutines.flow.take
88
import kotlinx.coroutines.runBlocking
9+
import kotlinx.io.files.Path
910
import kotlinx.serialization.*
11+
import wasm.execWasm
1012

1113
data class ProcessResult(val code: Int, val rawOutput: String?)
1214

@@ -18,7 +20,8 @@ fun main(args: Array<String>): Unit = runBlocking {
1820
println("Kotlin Native App: ${BuildConfig.version}")
1921
println(Greeting().greeting())
2022

21-
val count = args.firstOrNull()?.toIntOrNull() ?: 5
23+
val count = args.firstOrNull()?.toIntOrNull() ?: 2
24+
execWasm(Path("./factorial.wasm"), arg = count)
2225
timerComposeFlow().take(count).collect(::println)
2326

2427
println("Executing command...")
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package wasm
2+
3+
import io.github.charlietap.chasm.embedding.instance
4+
import io.github.charlietap.chasm.embedding.invoke
5+
import io.github.charlietap.chasm.embedding.module
6+
import io.github.charlietap.chasm.embedding.shapes.Value
7+
import io.github.charlietap.chasm.embedding.shapes.getOrNull
8+
import io.github.charlietap.chasm.embedding.shapes.map
9+
import io.github.charlietap.chasm.embedding.store
10+
import kotlinx.io.buffered
11+
import kotlinx.io.files.Path
12+
import kotlinx.io.files.SystemFileSystem
13+
import kotlinx.io.readByteArray
14+
15+
fun execWasm(path: Path, arg: Int = 5) {
16+
try {
17+
val exists = SystemFileSystem.metadataOrNull(path)?.isRegularFile == true
18+
if (exists) {
19+
println("Executing wasm: $path")
20+
val module = module(bytes = SystemFileSystem.source(path).buffered().readByteArray())
21+
val store = store()
22+
val instance = instance(store, module.getOrNull()!!, emptyList()).getOrNull()!!
23+
24+
val result =
25+
invoke(store, instance, "iterFact", listOf(Value.Number.I32(arg))).map {
26+
(it.first() as Value.Number.I32).value
27+
}
28+
println("Result: $result")
29+
} else {
30+
println("Wasm file not found: $path")
31+
}
32+
} catch (e: Exception) {
33+
println("Failed to execute wasm: ${e.message}")
34+
e.printStackTrace()
35+
}
36+
}

gradle/libs.versions.toml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ kotlinx-metadata = "0.9.0"
3636
kotlinx-reflect-lite = "1.1.0"
3737
kotlinx-bcv = "0.16.3"
3838
kotlin-dokka = "2.0.0-Beta"
39-
kotlin-wrappers = "1.0.0-pre.841"
39+
kotlin-wrappers = "1.0.0-pre.843"
4040
kotlin-redacted = "1.11.0"
4141
kotlinx-multik = "0.2.3"
4242
kotlinx-dataframe = "0.13.1"
4343
kotlinx-kandy = "0.5.0"
4444
evas = "1.1.0"
4545
kopy = "0.13.1+2.1.0"
46-
poko = "0.17.2"
46+
poko = "0.18.0"
4747
mappie = "0.9.2"
4848
akkurate = "0.10.0"
4949
kaml = "0.65.0"
5050
snakeyaml-engine-kmp = "3.0.3"
51-
konsist = "0.17.0"
51+
konsist = "0.17.2"
5252
karakum = "1.0.0-alpha.40-K2"
5353
seskar = "3.60.0"
5454
spring-boot = "3.4.0"
@@ -67,7 +67,7 @@ ksp-auto-service = "1.2.0"
6767
gradle-kotlin-dsl = "4.3.1"
6868
zip-prefixer = "0.3.1"
6969
ajalt-mordant = "3.0.1"
70-
ajalt-clikt = "5.0.1"
70+
ajalt-clikt = "5.0.2"
7171
ajalt-colormath = "3.6.0"
7272
classgraph = "4.8.177"
7373
cache4k = "0.13.0"
@@ -104,7 +104,7 @@ jspecify = "1.0.0"
104104
rsocket = "0.16.0"
105105
jctools = "4.0.5"
106106
kotlin-codepoints = "0.9.0"
107-
kotlin-logging = "7.0.0"
107+
kotlin-logging = "7.0.3"
108108
kotlin-bignum = "0.3.10"
109109
kotlin-diff = "0.7.0"
110110
kotlin-retry = "2.0.1"
@@ -166,7 +166,7 @@ langchain4j = "0.36.2"
166166
jlama = "0.8.3"
167167
ldaptive = "2.3.2"
168168
chicory = "1.0.0-M2"
169-
log4k = "0.26.0"
169+
log4k = "0.30.0"
170170

171171
# Compose
172172
jetbrains-compose = "1.7.1"
@@ -176,7 +176,8 @@ jetbrains-compose-adaptive = "1.0.1"
176176
kobweb = "0.20.0"
177177
detekt = "1.23.7"
178178
detekt-compose-rules = "0.4.19"
179-
compose-icons = "1.1.0"
179+
compose-hotreload = "1.0.0"
180+
compose-icons = "1.1.1"
180181
compose-routing = "0.4.0"
181182
kottie = "2.0.1"
182183
mosaic = "0.14.0"
@@ -191,7 +192,7 @@ swagger-style = "https://unpkg.com/[email protected]/them
191192

192193
# Plugin versions
193194
benmanes = "0.51.0"
194-
foojay-resolver = "0.8.0"
195+
foojay-resolver = "0.9.0"
195196
gradle-develocity = "3.18.2"
196197
nmcp = "0.0.9"
197198
nexus-publish = "2.0.0"
@@ -205,7 +206,7 @@ sigstore = "1.1.0"
205206
reproducible-builds = "1.0"
206207
autonomousapps-depanalysis = "2.5.0"
207208
autonomousapps-bestpractices = "0.10"
208-
graalvm-nativeimage = "0.10.3"
209+
graalvm-nativeimage = "0.10.4"
209210
github-depgraph = "0.1.0"
210211
github-changelog = "2.2.0"
211212
wire-plugin = "5.1.0"
@@ -378,6 +379,10 @@ ktor-client-encoding = { module = "io.ktor:ktor-client-encoding"
378379
ktor-client-mock = { module = "io.ktor:ktor-client-mock" , version.ref = "ktor"}
379380

380381
# krpc
382+
kotlinx-rpc-bom = { module = "org.jetbrains.kotlinx:kotlinx-rpc-bom" , version.ref = "kotlinx-rpc"}
383+
kotlinx-rpc-krpc-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-server" , version.ref = "kotlinx-rpc"}
384+
kotlinx-rpc-krpc-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-client" , version.ref = "kotlinx-rpc"}
385+
381386
kotlinx-rpc-runtime = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime" , version.ref = "kotlinx-rpc"}
382387
kotlinx-rpc-runtime-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-client" , version.ref = "kotlinx-rpc"}
383388
kotlinx-rpc-runtime-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-server" , version.ref = "kotlinx-rpc"}
@@ -659,7 +664,6 @@ kotlin-compose-compiler = { id = "org.jetbrains.kotlin.plugin.compo
659664
kotlinx-atomicfu = { id = "org.jetbrains.kotlinx.atomicfu" , version.ref = "kotlinx-atomicfu"}
660665
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark" , version.ref = "kotlinx-benchmark" }
661666
kotlinx-rpc = { id = "org.jetbrains.kotlinx.rpc.plugin" , version.ref = "kotlinx-rpc" }
662-
kotlinx-rpc-platform = { id = "org.jetbrains.kotlinx.rpc.platform" , version.ref = "kotlinx-rpc" }
663667
jetbrains-compose = { id = "org.jetbrains.compose" , version.ref = "jetbrains-compose"}
664668
ktor = { id = "io.ktor.plugin" , version.ref = "ktor" }
665669
exposed = { id = "com.jetbrains.exposed.gradle.plugin" , version.ref = "exposed-plugin" }

0 commit comments

Comments
 (0)