Make UniFFI Config parsing compatible with settings for other languages - #197
Open
markus2610 wants to merge 10 commits into
Open
Make UniFFI Config parsing compatible with settings for other languages#197markus2610 wants to merge 10 commits into
markus2610 wants to merge 10 commits into
Conversation
Support both [bindings.kotlin] nested format and flat format for backward compatibility in config parsing. Add default kotlin_targets when kotlin_multiplatform is enabled but no targets specified.
Features: - Add --kmp CLI flag to force Kotlin Multiplatform generation - Support both nested [bindings.kotlin] and flat config formats - Auto-populate default targets when KMP enabled without explicit targets - CLI flag overrides config file settings for flexibility Tests added: - test_config_parsing_nested_format: Validates [bindings.kotlin] parsing - test_config_parsing_flat_format: Validates flat format compatibility - test_kmp_flag_overrides_config: Ensures CLI flag takes precedence - test_kotlin_targets_defaults: Verifies auto-population of targets - test_explicit_targets_preserved: Respects user-specified targets
Member
|
Hi! Thanks for the contribution. Are you trying to add KMP support to your UniFFI project that already has bindings to other languages (e.g. Python)? |
paxbun
requested changes
Aug 24, 2025
paxbun
left a comment
Member
There was a problem hiding this comment.
I'll be working on these changes if you don't mind. Thanks for the contribution!
paxbun
enabled auto-merge (squash)
August 24, 2025 09:49
paxbun
disabled auto-merge
August 24, 2025 10:31
Contributor
|
@markus2610, have you had a chance to try this branch with your project to verify it solves the namespace issue? |
Author
|
@SalvatoreT Which branch? |
Author
|
@paxbun No only for IOS and Android |
Contributor
your Have you tried a local build of your |
Author
|
@SalvatoreT Yes, I use it in my project and it works. I have a shell script that I use to generate my bindings. |
SalvatoreT
removed their request for review
March 26, 2026 22:55
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.
Changes
The configuration format used in the upstream UniFFI repository stores settings for each language under a dedicated table, e.g.,
[bindings.<language name>]. However, the bindgen in Gobley tries to read those settings from the root, making it hard to use it with UniFFI bindings of other languages. This PR is to make Gobley read the settings from[bindings.kotlin], making it align with UniFFI bindgens for other languages.[bindings.kotlin]table.Config::kotlin_multiplatformto true.--no-multiplatform, which makes the bindgen override thevalue of
Config::kotlin_multiplatformin the config file and consider it asfalse.Testing
[bindgen.kotlin]to alluniffi.tomlfiles in the unit test projects.