Skip to content

adding KMP generator#1805

Draft
PabIo-GL wants to merge 2 commits into
heremaps:masterfrom
PabIo-GL:adding_kmp_generator
Draft

adding KMP generator#1805
PabIo-GL wants to merge 2 commits into
heremaps:masterfrom
PabIo-GL:adding_kmp_generator

Conversation

@PabIo-GL
Copy link
Copy Markdown

@PabIo-GL PabIo-GL commented Mar 16, 2026

Work in progress...

KmpGenerator focuses on generating Kotlin Multiplatform code.

  • SourceSet.COMMON: "expect" declarations
  • SourceSet.MAIN: "actual" implementations for JVM/Desktop
    JNI C++ bindings must be handled by the external Android/Ninja pipeline.

KmpGenerator is based on Kotlin generator, it reuses kotlin's .mustache files.
It initially produces the same output as Kotlin, which is intercepted and split into two files: expect(commonMain)/actual(jvmMain).
Each of those two .kt files needs to be properly converted before saving (this part is not yet complete).

Problems:
Finalizing conversion code goes quite slow as it requires to go over all errors from kotlin-KMP compiler (thrown when KMP test app is being compiled) and manually adding proper rules to fix errors.

Alternatives:

  1. Create KMP generator (perhaps even two instances) from scratch
  • separate .mustache for commonMain
  • separate .mustache for jvmMain

@PabIo-GL PabIo-GL force-pushed the adding_kmp_generator branch from f081152 to f68adad Compare March 16, 2026 21:28
@PabIo-GL PabIo-GL force-pushed the adding_kmp_generator branch from bc0a67a to ae3791c Compare March 25, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant