pokekotlin icon indicating copy to clipboard operation
pokekotlin copied to clipboard

Publish idiomatic packages for non-Kotlin / non-Gradle usage

Open sargunv opened this issue 7 months ago • 1 comments

  • [x] Java-friendly API on the JVM Maven package
  • [ ] Swift package for apple native builds
  • [x] NPM package with TS declarations for JS
  • [ ] C headers for native builds? Investigate packaging conventions here
  • [x] WASM package isn't possible due to @JsExport restrictions.

sargunv avatar Jun 11 '25 18:06 sargunv

Summary from some AI-assisted research:

KMP Library Multiplatform Release Plan

  • What to publish:

    • JS: ESM NPM package
    • WASM: ESM NPM package (with .wasm and glue JS)
    • Apple: XCFramework ZIP for all Apple targets
    • Native (Linux/Windows): .so/.dll + C headers (for C/C++ FFI)
  • Where to publish:

    • JS/WASM: npmjs.com (separate or combined packages; wrapper package for runtime selection if needed)
    • Apple: Host XCFramework ZIP (e.g. GitHub Releases), reference in a Package.swift in a Git repo for SPM
    • Native: GitHub Releases (or Conan/vcpkg for C/C++ users)
  • Tools needed:

    • Gradle (KMP, jgitver for versioning)
    • npm-publish plugins
    • (Optional) multiplatform-swiftpackage for SPM
    • Conan/vcpkg for C/C++ packaging
    • CI for building, publishing, and automating manifest/version updates
  • Release process changes:

    • Trigger release on main branch (not on tag)
    • Build/publish all artifacts
    • Update SPM Package.swift with correct versioned URL/checksum
    • Commit and tag the manifest repo as the final step

sargunv avatar Jun 25 '25 21:06 sargunv