Skip to content

[DO NOT MERGE] Migrates to Kotlin's upcoming SwiftPM import feature#598

Draft
JayShortway wants to merge 8 commits intomainfrom
spm-import
Draft

[DO NOT MERGE] Migrates to Kotlin's upcoming SwiftPM import feature#598
JayShortway wants to merge 8 commits intomainfrom
spm-import

Conversation

@JayShortway
Copy link
Copy Markdown
Member

@JayShortway JayShortway commented Dec 8, 2025

Description

Migrates the library to make use of Kotlin's upcoming SwiftPM import feature. This Kotlin feature is in preview, and still has the following rough edges to smooth out:

Issue Description Affects
Customers using direct integration (embedAndSignAppleFrameworkForXcode) will have to run integrateLinkagePackage to generate the _internal_linkage_SwiftPMImport package and commit it to version control. consumers of purchases-kmp
KT-82766 Some Kotlin bindings are generated twice, once in the objcnames package. This shows unresolved type errors in the IDE, but it builds and runs fine. developers of purchases-kmp
KT-74692 Hard to structure the project when multiple modules depend on the same SPM package. Cannot influence the namespace for the generated Kotlin bindings, nor are they exposed as if they were an api() dependency. Workaround: set kotlin.mpp.enableCInteropCommonization=true in gradle.properties. developers of purchases-kmp
✅ Fixed in titan-208 integrateLinkagePackage creates a project.pbxproj file that fails validation by the checkSyntheticImportProjectIsCorrectlyIntegrated task which is run at build time. Can be silenced using the kotlin.kmp.suppressXcodeIntegrationCheck=true property. developers of purchases-kmp

Note for review

I would highly recommend reviewing this 1 commit at a time. That reduces the complexity considerably. Most of the changed files are due to import statements. I also added a migration guide.

Release plan

My plan is to release this branch as 3.0.0-dev01 after approval, without merging it. Let me know what you think of that too.

@JayShortway JayShortway self-assigned this Dec 8, 2025
@JayShortway JayShortway added pr:breaking Changes that are breaking pr:other labels Dec 8, 2025
@JayShortway JayShortway force-pushed the spm-import branch 2 times, most recently from a1824a9 to 3be52a9 Compare December 8, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:breaking Changes that are breaking pr:other

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant