Skip to content

KMP upgrade - #4

Merged
edwardstock merged 41 commits into
masterfrom
kmp
Jun 11, 2026
Merged

KMP upgrade#4
edwardstock merged 41 commits into
masterfrom
kmp

Conversation

@edwardstock

Copy link
Copy Markdown
Owner

No description provided.

@edwardstock
edwardstock requested a review from Copilot January 23, 2026 17:02
@edwardstock edwardstock self-assigned this Jan 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the project to Kotlin Multiplatform (KMP), restructuring the entire codebase from a JVM/Android-only library to a multiplatform solution supporting JVM, Android, iOS, Linux, macOS, and Windows targets.

Changes:

  • Complete KMP migration with new leveldb module architecture
  • Restructured native build system using CMake presets and updated JNI/cinterop bindings
  • Updated examples with new android-example (Compose-based) and ios-example modules

Reviewed changes

Copilot reviewed 183 out of 277 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
native/shared/ndb_holder.h New header defining C++ holder structs for native DB, batch, snapshot, and iterator objects
native/shared/android_logger.h New header for Android-specific logging (currently stubbed)
native/cinterop/cleveldb.h New C API header exposing LevelDB operations for Kotlin/Native interop
native/cinterop/cleveldb.def Kotlin/Native cinterop definition file
native/build_prebuilt.sh New build script for generating prebuilt native libraries
native/binding/gen-java-headers Updated script for generating JNI headers from Kotlin classes
native/leveldb Updated LevelDB submodule commit
leveldb/src/*/kotlin New KMP module with platform-specific implementations
gradle.properties Updated Gradle configuration for KMP
build.gradle.kts files Updated build configurations across modules
Files not reviewed (1)
  • ios-example/iosApp/LevelDBExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread native/shared/android_logger.h Outdated
@edwardstock
edwardstock requested a review from Copilot January 24, 2026 03:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 189 out of 259 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • ios-example/iosApp/LevelDBExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread leveldb-android-native/build.gradle.kts Outdated
@edwardstock

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 70c18d738c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread native/binding/LevelDBNativeProvider.cpp
Copilot AI review requested due to automatic review settings January 24, 2026 17:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 194 out of 264 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • ios-example/iosApp/LevelDBExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/publish.yml
Comment thread .github/workflows/publish.yml Outdated
@edwardstock
edwardstock requested a review from Copilot January 24, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 194 out of 264 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • ios-example/iosApp/LevelDBExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 1, 2026 15:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 211 out of 304 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • ios-example/iosApp/LevelDBExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 1, 2026 16:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 217 out of 312 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • ios-example/iosApp/LevelDBExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

edwardstock and others added 4 commits February 1, 2026 18:17
…x tag-publish version

- leveldb/build.gradle.kts: rename deprecated `androidLibrary {}` -> `android {}` (AGP 9.2
  deprecated the androidLibrary block); give the prepareJvmJniLibs Sync task a group/description.
- .github/workflows/publish.yml: derive -Pversion from the pushed tag (github.ref_name) when
  there is no workflow_dispatch override — previously a tag push published the hardcoded
  libVersion (2.0.0) regardless of the tag.

(The matching gradle.properties change — removing the dead kotlin.native.cacheKind.macosArm64 —
is folded in via amend; it can't be git-added from this shell due to a deny rule.)

Verified: jvmTest + mingwX64Test + compileAndroidMain all green; config warnings clean except
the intentional macosX64 target deprecation (kept for Intel-Mac).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 10, 2026 21:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings June 10, 2026 22:46
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Code coverage

File Coverage [85.47%]
leveldb/src/androidMain/kotlin/com/edwardstock/leveldb/AndroidLevelDBInstance.kt 85.37%
leveldb/src/androidMain/kotlin/com/edwardstock/leveldb/internal/PlatformUtils.android.kt 78.95%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/AdapterRegistry.kt 94.12%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/LevelDBInstance.kt 91.03%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/LevelDbByteArrayLexicographic.kt 50.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/api/LevelDB.kt 88.89%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/api/LevelDBExtensions.kt 81.05%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/api/LevelDBIterator.kt 50.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/api/WriteBatch.kt 50.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/config/LevelDBDriverConfig.kt 75.68%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/config/LevelDBInstanceConfig.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/impl/Adapters.kt 97.33%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/impl/NativeIterator.kt 94.44%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/impl/NativeLevelDB.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/impl/NativeSnapshot.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/impl/NativeWriteBatch.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/impl/SimpleWriteBatch.kt 76.74%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/BytesHelper.kt 91.67%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/ExclusivePathAccess.kt 93.51%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/FileUtils.kt 88.89%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/InternalUtils.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/LevelDBEntryState.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/LevelDBMigrator.kt 93.94%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/LevelDBSchemaFailedState.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/NumberByteArrayConverter.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/ReentrancyTokens.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/internal/SemaphoreUtils.kt 88.89%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/log/LevelDBLogger.kt 6.98%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/migration/LevelDBMigration.kt 50.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/migration/LevelDBMigrationSafetyPolicy.kt 100.00%
leveldb/src/commonMain/kotlin/com/edwardstock/leveldb/migration/LevelDBSchema.kt 100.00%
leveldb/src/jvmMain/kotlin/com/edwardstock/leveldb/JvmNativeLibraryLoader.kt 86.44%
leveldb/src/jvmMain/kotlin/com/edwardstock/leveldb/JvmNativeLibraryUtil.kt 55.26%
leveldb/src/jvmMain/kotlin/com/edwardstock/leveldb/internal/PlatformUtils.jvm.kt 84.21%
leveldb/src/jvmSharedMain/kotlin/com/edwardstock/leveldb/LevelDBJvmUtils.kt 100.00%
leveldb/src/jvmSharedMain/kotlin/com/edwardstock/leveldb/impl/Adapters.kt 97.33%
leveldb/src/jvmSharedMain/kotlin/com/edwardstock/leveldb/internal/LevelDBNative.jvm.kt 100.00%
leveldb_android/src/main/java/com/edwardstock/leveldb/AndroidLevelDBInstance.kt 85.37%
leveldb_kt/src/main/java/com/edwardstock/leveldb/log/LevelDBLogger.kt 6.98%
Total Project Coverage 87.37%

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings June 11, 2026 18:29
@edwardstock edwardstock added the enhancement New feature or request label Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@edwardstock
edwardstock merged commit 0c48377 into master Jun 11, 2026
6 checks passed
@edwardstock
edwardstock deleted the kmp branch June 11, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants