Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pluginManagement {
```kotlin
// build.gradle.kts
plugins {
kotlin("multiplatform") version "2.3.20"
kotlin("multiplatform") version "2.4.20"
id("dev.nucleusframework.nna") version "0.1.0"
}
```
Expand All @@ -63,7 +63,7 @@ kotlin {
jvm()

sourceSets {
val jvmMain by getting {
jvmMain {
dependencies {
// your JVM dependencies (Compose, Ktor, etc.)
}
Expand Down Expand Up @@ -341,7 +341,7 @@ calc.add(5) // works normally after exception

## Benchmarks — Native (FFM) vs Pure JVM

Measured on Intel Core i5-14600 (20 cores), 45 GB RAM, Ubuntu 25.10, JDK 25 (GraalVM), Kotlin 2.3.20.
Measured on Intel Core i5-14600 (20 cores), 45 GB RAM, Ubuntu 25.10, JDK 25 (GraalVM), Kotlin 2.4.20.

**Methodology**: each benchmark runs the operation in a tight loop. 3 warmup iterations are discarded, then 5 measured iterations are averaged. "Native" creates a proxy object via FFM and calls into the Kotlin/Native shared library (.so). "JVM" runs the equivalent Kotlin/JVM code directly. Ratio = native/jvm (>1 = native slower due to FFM overhead). Memory is measured via `Runtime.totalMemory() - freeMemory()` before/after with explicit GC.

Expand Down Expand Up @@ -488,7 +488,7 @@ my-app/

```kotlin
plugins {
kotlin("multiplatform") version "2.3.20"
kotlin("multiplatform") version "2.4.20"
id("dev.nucleusframework.nna")
}

Expand All @@ -508,9 +508,9 @@ kotlinNativeExport {

```kotlin
plugins {
kotlin("multiplatform") version "2.3.20"
id("org.jetbrains.compose") version "1.10.2"
id("org.jetbrains.kotlin.plugin.compose") version "2.3.20"
kotlin("multiplatform") version "2.4.20"
id("org.jetbrains.compose") version "1.12.1"
id("org.jetbrains.kotlin.plugin.compose") version "2.4.20"
id("io.github.kdroidfilter.nucleus") version "1.7.2"
}

Expand All @@ -519,7 +519,7 @@ kotlin {
jvm()

sourceSets {
val jvmMain by getting {
jvmMain {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":native"))
Expand All @@ -544,7 +544,7 @@ You can combine the plugin with Kotlin/Native cinterop to wrap native C librarie
// build.gradle.kts
kotlin {
linuxX64().compilations["main"].cinterops {
val libnotify by creating {
create("libnotify") {
defFile(project.file("src/nativeInterop/cinterop/libnotify.def"))
}
}
Expand Down Expand Up @@ -632,7 +632,7 @@ Data classes are supported as value types (field marshalling), and `commonMain`

## Requirements

- **Kotlin** 2.3.20+
- **Kotlin** 2.4.20+
- **Gradle** 9.1+ (for JDK 25 support)
- **JDK** 22+ (FFM stable since JDK 22 / JEP 454), recommended 25
- **Kotlin/Native** toolchain (bundled with KMP plugin)
Expand Down
2 changes: 1 addition & 1 deletion examples/benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kotlin {
jvm()

sourceSets {
val jvmTest by getting {
jvmTest {
dependencies {
implementation(kotlin("test"))
}
Expand Down
11 changes: 6 additions & 5 deletions examples/calculator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import io.github.kdroidfilter.nucleus.desktop.application.dsl.TargetFormat

plugins {
kotlin("multiplatform")
id("org.jetbrains.compose") version "1.10.2"
id("org.jetbrains.kotlin.plugin.compose") version "2.3.20"
id("org.jetbrains.compose") version "1.12.1"
id("org.jetbrains.kotlin.plugin.compose") version "2.4.20"
id("org.jetbrains.compose.hot-reload") version "1.3.0-beta01"
id("io.github.kdroidfilter.nucleus") version "1.7.2"
id("dev.nucleusframework.nna")
}
Expand All @@ -23,14 +24,14 @@ kotlin {
jvm()

sourceSets {
val jvmMain by getting {
jvmMain {
dependencies {
implementation(compose.desktop.currentOs)
implementation(compose.runtime)
implementation("org.jetbrains.compose.runtime:runtime:1.12.1")
implementation("io.github.kdroidfilter:nucleus.graalvm-runtime:1.7.2")
}
}
val jvmTest by getting {
jvmTest {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit5"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.example.calculator

import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
import kotlin.test.assertNotEquals
import java.lang.Math.PI
Expand Down Expand Up @@ -583,13 +584,13 @@ class InheritanceTest {

@Test fun `Circle is not Rectangle`() {
Circle(2.0).use { circle ->
assertTrue(circle !is Rectangle)
assertFalse(Rectangle::class.isInstance(circle))
}
}

@Test fun `Cube is not Cylinder`() {
Cube(2.0).use { cube ->
assertTrue(cube !is Cylinder)
assertFalse(Cylinder::class.isInstance(cube))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class InterfaceTest {

@Test fun `Scale - does not implement Printable`() {
Scale(10.0).use { scale ->
assertFalse(scale is Printable)
assertFalse(Printable::class.isInstance(scale))
}
}

Expand Down Expand Up @@ -440,7 +440,7 @@ class InterfaceTest {
assertTrue(ruler is Measurable)
assertTrue(ruler is Printable)
assertTrue(scale is Measurable)
assertFalse(scale is Printable)
assertFalse(Printable::class.isInstance(scale))
}
}
}
Expand Down
19 changes: 10 additions & 9 deletions examples/systeminfo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import io.github.kdroidfilter.nucleus.desktop.application.dsl.TargetFormat

plugins {
kotlin("multiplatform")
id("org.jetbrains.compose") version "1.10.2"
id("org.jetbrains.kotlin.plugin.compose") version "2.3.20"
id("org.jetbrains.compose") version "1.12.1"
id("org.jetbrains.kotlin.plugin.compose") version "2.4.20"
id("org.jetbrains.compose.hot-reload") version "1.3.0-beta01"
id("io.github.kdroidfilter.nucleus") version "1.7.2"
id("dev.nucleusframework.nna")
}
Expand Down Expand Up @@ -41,13 +42,13 @@ kotlin {
// cinterop with libnotify (real Linux native notifications via D-Bus)
if (hostOs == "Linux") {
nativeTarget.compilations["main"].cinterops {
val libnotify by creating {
create("libnotify") {
defFile(project.file("src/nativeInterop/cinterop/libnotify.def"))
}
val systray by creating {
create("systray") {
defFile(project.file("src/nativeInterop/cinterop/systray.def"))
}
val gio by creating {
create("gio") {
defFile(project.file("src/nativeInterop/cinterop/gio.def"))
}

Expand All @@ -57,7 +58,7 @@ kotlin {
// cinterop with Win32 Shell API (tray icon + toast notifications)
if (hostOs.startsWith("Windows")) {
nativeTarget.compilations["main"].cinterops {
val wintray by creating {
create("wintray") {
defFile(project.file("src/nativeInterop/cinterop/wintray.def"))
}
}
Expand All @@ -66,15 +67,15 @@ kotlin {
jvm()

sourceSets {
val jvmMain by getting {
jvmMain {
dependencies {
implementation(compose.desktop.currentOs)
implementation(compose.runtime)
implementation("org.jetbrains.compose.runtime:runtime:1.12.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.10.2")
implementation("io.github.kdroidfilter:nucleus.graalvm-runtime:1.7.2")
}
}
val jvmTest by getting {
jvmTest {
dependencies {
implementation(kotlin("test"))
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "2.3.20"
kotlin = "2.4.20"
pluginPublish = "2.1.0"
versionCheck = "0.53.0"
kotlinx-coroutines = "1.11.0"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-all.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 4 additions & 7 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading