Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
299f0b4
build: bump Kotlin to 2.4.20 and Gradle to 9.8.0
lemcoder Sep 28, 2026
e24e730
chore: add Kotlin sources at v2.4.20 as a sparse submodule
lemcoder Sep 30, 2026
12bfd8d
docs: draft the interop architecture
lemcoder Oct 3, 2026
6344446
feat: export cinterop's NativeIndex out of the Kotlin/Native distribu…
lemcoder Oct 3, 2026
ae253c1
chore: remove the Kotlin sources submodule
lemcoder Oct 3, 2026
1bba4ec
refactor: build the index through cinterop's own buildNativeLibrary
lemcoder Oct 4, 2026
3468cca
refactor: run generators inside the index exporter
lemcoder Oct 4, 2026
2f9921a
refactor: name the pinned distribution for what it is
lemcoder Oct 4, 2026
adf5a17
feat: generate JNI bindings from cinterop's NativeIndex
lemcoder Oct 4, 2026
63647fc
fix: register an Android app's jniLibs once
lemcoder Oct 4, 2026
9c4b34e
feat: generate FFM bindings with jextract from the same index
lemcoder Oct 4, 2026
9ec695e
feat: bind Kotlin/Native through KGP's cinterop with kotlinNativeInterop
lemcoder Oct 5, 2026
2506bd1
docs: record the generator architecture as built
lemcoder Oct 5, 2026
e14289f
feat!: replace the plugin DSL with a typed konan extension
lemcoder Oct 5, 2026
de93a8e
feat!: binding consumers and external builds for the JNI stub
lemcoder Oct 5, 2026
7109f58
feat!: sealed library providers over the shared external build
lemcoder Oct 5, 2026
56cbd10
feat: prebuilt libraries
lemcoder Oct 5, 2026
3a6b1dc
refactor!: model package, Kotlin touchpoints behind kotlin/, split DSL
lemcoder Oct 6, 2026
c58c984
feat: FFM bindings on Android through PanamaPort
lemcoder Oct 6, 2026
873240d
feat: FFM shared library from the project's build or prebuilt
lemcoder Oct 6, 2026
61010a4
feat: CMake preset for the FFM shared library
lemcoder Oct 6, 2026
c9f1cfa
feat: Kotlin/Native toolchain for external builds, Make preset, libra…
lemcoder Oct 7, 2026
a29fc0f
feat: Cargo preset, FFM for multiplatform jvm(), dependency fetching
lemcoder Oct 8, 2026
f24fefb
feat: konan { config { } } for machine paths, exporters for Kotlin 2.…
lemcoder Oct 13, 2026
bb445a7
docs: Kotlin Multiplatform example for iOS, macOS, Linux and Android
lemcoder Oct 15, 2026
fa7fc30
refactor: one set of build systems, one generation task, packages nes…
lemcoder Oct 15, 2026
0f3753e
refactor: libraries' and bindings' implementation beside their DSL
lemcoder Oct 15, 2026
2934a52
refactor: each type in the package of the DSL block it serves
lemcoder Oct 16, 2026
2ce9f0b
feat: Android links carry libc++ and the unwinder; one Android exampl…
lemcoder Oct 20, 2026
32d6849
fix: version 2.0.0-alpha01, and refuse to publish a version the Porta…
lemcoder Oct 26, 2026
b7a61bf
fix: a CMake build directory overrides the preset's binaryDir
lemcoder Oct 26, 2026
2ecfd29
fix: a JVM jar builds only the JVM targets' native libraries
lemcoder Oct 26, 2026
fe523e3
feat: merge the archives a library's build leaves into one
lemcoder Oct 26, 2026
e0b7140
feat: konan.config.androidNdk for Android external builds
lemcoder Oct 26, 2026
77ac3cf
feat: Android libraries are built with the Android NDK, which they re…
lemcoder Oct 26, 2026
cca6bd3
feat: androidNdk defaults to the NDK the module's Android Gradle plug…
lemcoder Oct 26, 2026
e928798
docs: README features, Android NDK setup, and 2.0 migration notes
lemcoder Oct 26, 2026
f40b755
fix: a .def without a package binds into one named after the file
lemcoder Oct 26, 2026
a172fc9
fix: a job count for CMake, and one external build at a time
lemcoder Oct 26, 2026
37f1474
fix: a consumer of one target builds only that target's library
lemcoder Oct 26, 2026
452d157
chore: version 2.0.0-alpha02
lemcoder Oct 27, 2026
86f5df5
fix: Android packaging builds only the Android targets' libraries
lemcoder Oct 27, 2026
9d4eea4
feat: cmake { sources } makes a CMake build up to date
lemcoder Oct 27, 2026
a413c23
ci: test on Linux x64, and on Linux arm64 with an unofficial Kotlin/N…
lemcoder Oct 29, 2026
d03ccba
fix: a target named twice registers its tasks once
lemcoder Oct 29, 2026
f54bf86
ci: install JetBrains' Kotlin/Native from its GitHub release
lemcoder Oct 29, 2026
78467c1
fix: Kotlin/Native's LLVM is downloaded on a machine that has never h…
lemcoder Oct 29, 2026
0352635
chore: version 2.0.0-alpha03
lemcoder Nov 2, 2026
56dc4b4
fix: JNI strings cross as real UTF-8
lemcoder Nov 2, 2026
fbc473a
chore: version 2.0.0-alpha04-SNAPSHOT
lemcoder Nov 2, 2026
fe711e6
fix: generated KMP JNI sources carry their producer
lemcoder Nov 2, 2026
b70101a
fix: tasks needing Kotlin/Native run after KGP's download
lemcoder Nov 2, 2026
04f9170
chore: version 2.0.0-alpha04
lemcoder Nov 2, 2026
9bbc361
docs: changelog for 2.0.0-alpha03 and alpha04
lemcoder Nov 3, 2026
d63f9c0
ci: drop the unofficial Linux arm64 job
lemcoder Nov 3, 2026
45d7e33
feat: pointers to records cross JNI as typed handles
lemcoder Nov 2, 2026
69ac93e
test: typed handles round-trip through JNI on the JVM
lemcoder Nov 3, 2026
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
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on:
push:
branches: [main, feature/**]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: test (linux-x64)
runs-on: ubuntu-24.04
env:
KONAN_VERSION: "2.4.20"
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- uses: gradle/actions/setup-gradle@v4

- name: Install build tools
run: |
sudo apt-get update -q
sudo apt-get install -y -q cmake make
command -v cargo || curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
~/.cargo/bin/cargo --version

- name: Cache Kotlin/Native
uses: actions/cache@v4
with:
path: ~/.konan
key: konan-linux-x64-${{ env.KONAN_VERSION }}

# The tests find the distribution at ~/.konan/kotlin-native-prebuilt-<host>-<version>, where the Kotlin
# Gradle plugin installs it; without it they skip.
- name: Install Kotlin/Native
run: |
dist=kotlin-native-prebuilt-linux-x86_64-$KONAN_VERSION
if [ ! -d ~/.konan/$dist ]; then
mkdir -p ~/.konan
curl -sSfL "https://github.com/JetBrains/kotlin/releases/download/v$KONAN_VERSION/$dist.tar.gz" | tar -xz -C ~/.konan
fi

- name: Check Kotlin/Native
run: |
home=~/.konan/kotlin-native-prebuilt-linux-x86_64-$KONAN_VERSION
"$home/bin/kotlinc-native" -version

- name: Test
run: ./gradlew test -PkotlinNativeVersion=$KONAN_VERSION --continue

- name: Test summary
if: always()
run: |
python3 - <<'EOF' >> "$GITHUB_STEP_SUMMARY"
import glob, xml.etree.ElementTree as ET
rows, totals = [], [0, 0, 0]
for f in sorted(glob.glob("build/test-results/test/*.xml")):
suite = ET.parse(f).getroot()
for case in suite.iter("testcase"):
outcome = next((c.tag for c in case if c.tag in ("failure", "error", "skipped")), "passed")
totals[0 if outcome == "passed" else 2 if outcome == "skipped" else 1] += 1
if outcome != "passed":
detail = next(c for c in case if c.tag == outcome).get("message", "") or ""
rows.append(f"| {outcome} | {case.get('name')} | {detail.splitlines()[0][:150] if detail else ''} |")
print(f"### linux-x64: {totals[0]} passed, {totals[1]} failed, {totals[2]} skipped\n")
if rows:
print("| Outcome | Test | Message |\n|---|---|---|")
print("\n".join(rows))
EOF

- uses: actions/upload-artifact@v4
if: always()
with:
name: test-reports-linux-x64
path: build/reports/tests/test
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog

Versions are published to the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/io.github.lemcoder.konanplugin)
and never republished. 2.0 replaces 1.x's DSL; the README's migration notes cover the move.

## 2.0.0-alpha04

### Fixed
- **JNI strings cross as real UTF-8** ([#14](https://github.com/lemcoder/KonanPlugin/issues/14)). `const char*`
went through `GetStringUTFChars`/`NewStringUTF`, which speak modified UTF-8: a character outside the BMP
(👍, 𠀀) reached C as two encoded surrogates on HotSpot, and a 4-byte sequence returned from C is undefined
behavior that CheckJNI aborts on. Strings now cross as NUL-terminated UTF-8 bytes. The bindings keep their
`String?` signatures; each wraps a private `external` named `<name>$kni`.
- **Generated KMP JNI sources carry their producer** ([#15](https://github.com/lemcoder/KonanPlugin/pull/15)).
The generated bindings were added to multiplatform JVM and Android source sets without a task dependency,
so anything but the compile, such as `androidSourcesJar` or `jvmSourcesJar` when publishing, failed with
*"uses this output of task ':generateJni…' without declaring an explicit or implicit dependency"*.
- **Tasks needing Kotlin/Native run after KGP's download** ([#16](https://github.com/lemcoder/KonanPlugin/issues/16)).
With `konanHome.set(kotlinNativeDistribution())`, `generateJni<Name>`, `konanClang<Name><Target>`,
`linkJni<Name><Target>` and the other tasks needing Kotlin/Native could run before the Kotlin plugin's
`downloadKotlinNativeDistribution` and fail on a machine without that distribution. They now depend on it
when it exists (Kotlin 2.3 and newer) and `konanHome` is the directory it installs. Builds that added this
`dependsOn` themselves can drop it.

## 2.0.0-alpha03

### Added
- `cmake { sources }`: declared sources make a CMake build up to date when they have not changed ([#13](https://github.com/lemcoder/KonanPlugin/issues/13)).

### Fixed
- Android packaging (APK, AAR) builds only the Android targets' libraries, not the host's
([#12](https://github.com/lemcoder/KonanPlugin/issues/12)).
- A target named twice registers its tasks once.
- Kotlin/Native's LLVM is downloaded on a machine that has never had it, instead of failing the first
compile.
Loading
Loading