Repository navigation
feat(kmp): graduate shared-core to real KMP module — Base58 + randomBytes - #1201
Merged
Merged
Conversation
…k umbrella Establishes the umbrella model for cross-platform code sharing: - kmp/shared-core becomes a thin aggregator that api-exports real KMP modules and publishes ONE SharedCore XCFramework (KMMBridge/SPM) so iOS consumes everything through a single import. It owns no logic itself. - :libs:encryption:base58 becomes the first real KMP module (the pilot): pure Base58 in commonMain, JDK-only helpers (encodeChecked/decodeChecked/ hashTwice/decodeToBigInteger) in androidMain, iOS targets via the default hierarchy template (no manual source-set wiring). shared-core re-exports it. - The base58.json cross-platform vector gate now runs on BOTH the JVM and native targets (commonTest + a readResource expect/actual). - All 9 Android consumers keep depending on :libs:encryption:base58 unchanged — the KMP module still exposes the Android variant. - Adds a flipcash.kmp.library convention plugin (registered; to be adopted by the next KMP modules). Verified: base58 iOS compile, host vector gate, all 9 consumers + app compile, and :kmp:shared-core:spmDevBuild produces SharedCore.xcframework.
bmc08gt
force-pushed
the
feat/kmp-shared-core-real
branch
from
August 7, 2026 18:14
372100a to
54eb4e6
Compare
7 tasks
bmc08gt
added a commit
that referenced
this pull request
Aug 7, 2026
KMP library modules (com.android.kotlin.multiplatform.library + withHostTest {})
expose `testAndroidHostTest`, not the `testDebugUnitTest` that com.android.library
modules expose. The flipcashTestDebug aggregate only bucketed modules into
android (`testDebugUnitTest`) and pure-JVM (`test`), so once base58 became a KMP
module (#1201) it landed in the android bucket and the aggregate depended on a
non-existent `:libs:encryption:base58:testDebugUnitTest` — silently skipping /
breaking the base58 vector gate in the aggregate. This PR's sha256/sha512/hmac
KMP conversions would extend the same fault.
Add a kmpUnitTestModules list (base58 + sha256/sha512/hmac), exclude it from the
android bucket, exclude the testless :kmp:shared-core umbrella, and depend on
`testAndroidHostTest` for the KMP modules so their host tests run in the aggregate.
Verified: `./gradlew flipcashTestDebug --dry-run` resolves the full task graph
(exit 0) with the KMP host-test tasks wired in.
bmc08gt
added a commit
that referenced
this pull request
Aug 7, 2026
) * feat(kmp): convert sha256/sha512/hmac to KMP modules via kotlincrypto * fix(kmp): wire KMP modules' testAndroidHostTest into flipcashTestDebug KMP library modules (com.android.kotlin.multiplatform.library + withHostTest {}) expose `testAndroidHostTest`, not the `testDebugUnitTest` that com.android.library modules expose. The flipcashTestDebug aggregate only bucketed modules into android (`testDebugUnitTest`) and pure-JVM (`test`), so once base58 became a KMP module (#1201) it landed in the android bucket and the aggregate depended on a non-existent `:libs:encryption:base58:testDebugUnitTest` — silently skipping / breaking the base58 vector gate in the aggregate. This PR's sha256/sha512/hmac KMP conversions would extend the same fault. Add a kmpUnitTestModules list (base58 + sha256/sha512/hmac), exclude it from the android bucket, exclude the testless :kmp:shared-core umbrella, and depend on `testAndroidHostTest` for the KMP modules so their host tests run in the aggregate. Verified: `./gradlew flipcashTestDebug --dry-run` resolves the full task graph (exit 0) with the KMP host-test tasks wired in.
bmc08gt
added a commit
that referenced
this pull request
Aug 7, 2026
…compile gate (#1205) * fix(kmp): restore Java interop for sha256/sha512 KMP modules - Sha256Hash.bytes: internal → public val (restores cross-module Kotlin access and the auto-generated Java getBytes() accessor; removes now- redundant explicit getBytes() method that would clash with the getter) - Sha256Hash companion functions: add @JvmStatic so Java callers can resolve hash(), hashTwice(), wrap(), wrapReversed(), of(), twiceOf() as static methods - PBKDF2SHA512.derive: add @JvmStatic so Java callers can call PBKDF2SHA512.derive(...) from a static context - MnemonicCode.java: replace Sha256Hash.newDigest() (an androidMain extension, not Java-callable) with an inline MessageDigest.getInstance call; Sha256Hash.hash() now resolves via @JvmStatic above * ci: add cred-free compile-check job to catch KMP interop regressions Adds a compile-check job that runs :apps:flipcash:app:compileDebugSources before the flipcash-tests job. This task compiles all Kotlin/Java sources but stops before processDebugGoogleServices, so it requires no secrets. The missing gate is what allowed the KMP conversions in #1201 and #1202 to land on code/cash without surfacing the Java interop breaks (missing @JvmStatic, internal visibility) — those were only caught by compiling the full consumer graph, which CI never did without creds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
libs:encryption:base58from single-platform Android module to a proper KMP module withcommonMain,androidMain,iosArm64,iosSimulatorArm64, andiosX64targetsBase58.ktis pure Kotlin incommonMain(no JDK deps); JDK-only code stays inandroidMainkmp/shared-coreslimmed to a thin umbrella: re-exports base58 viaapi()+export()in iOS framework blocks;spmDevBuildproducesSharedCore.xcframeworkKmpLibraryConventionPlugin, catalog entries forkotlin-multiplatform,android-kotlin-multiplatform-library, andkmmbridgeKey technical finding
alias(libs.plugins.flipcash.kmp.library)in aplugins {}block means the convention plugin applies KMP programmatically — Gradle does NOT generate a type-safekotlin {}accessor for the build script body. Usingkotlin("multiplatform")directly inplugins {}is required for the accessor to work. TheKmpLibraryConventionPluginis registered for future modules but modules must useextensions.configure<KotlinMultiplatformExtension>{}if they use the alias form.Test plan
:libs:encryption:base58:compileKotlinIosArm64— PASS:libs:encryption:base58:testAndroidHostTest— PASS (commonTest vectors gate):kmp:shared-core:compileKotlinIosArm64— PASS:kmp:shared-core:spmDevBuild— PASS (XCFramework atkmp/shared-core/build/XCFrameworks/debug/SharedCore.xcframework)libs:encryption:base58consumers compile — PASS:apps:flipcash:app:compileDebugSources— PASS