-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Don't merge] Seperate bindings #1205
Closed
Closed
Conversation
This file contains 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
bendk
force-pushed
the
seperate-bindings
branch
3 times, most recently
from
April 4, 2022 23:38
d97f416
to
059f9b8
Compare
Added code to allow external bindings crates to find the UDL files and cdylibs for examples/fixtures. Made a new crate for this, since I didn't want to pull in `serde` as a dependency for `uniffi`. Eventually, this can replace `uniffi/testing.rs` and we can remove some other dependencies from `uniffi` like `cargo_metadata`. Standardized the crate names for fixtures/examples. I think we're going to need to publish these to crates.io eventually. Added `Cargo.toml` config section that lists external clates for `ext-types` We copy the dylibs for external crates as well as our own. I think this should fix mozilla#1183.
Moved the code to it's own crate and changed it to use the `BindingGenerator` trait.
Created new test code on Kotlin to run the unit tests using on the `uniffi_testing` crate. Moved tests from the examples/fixtures directories to `uniffi_bindgen_kotlin/tests`. Updated `uniffi_testing` to include a hash of the script path in the `out_dir` filename. This prevents issues when we have 2 scripts running against the same fixture like `test_coverall.kts` and `test_coverall_handlerace.kts`. Normalized more fixture crate names.
Moved the code to it's own crate and changed it to use the `BindingGenerator` trait. Removed the `exception_name()` filter, which was never used.
Created new test code on Swift to run the unit tests using on the `uniffi_testing` crate. Moved tests from the examples/fixtures directories to `uniffi_bindgen_swift/tests`. Normalized more fixture crate names.
Moved the code to it's own crate and changed it to use the `BindingGenerator` trait. Removed the `filters::exception_name()` and `PythonWrapper::initialization_code()' functions, which were never used.
Created new test code on Python to run the unit tests using on the `uniffi_testing` crate. Moved tests from the examples/fixtures directories to `uniffi_bindgen_python/tests`.
Moved the code to it's own crate and changed it to use the `BindingGenerator` trait.
Created new test code on Ruby to run the unit tests using on the `uniffi_testing` crate. Moved tests from the examples/fixtures directories to `uniffi_bindgen_ruby/tests`. Removed the last bits of the old testing code.
Documented the separate bindings changes. Added some backwards compatibility to `uniffi-bindgen generate`. It now tries to run the binary from the external bindings crate using the same flags passed to it.
3 tasks
This one can't land until we figure out the versioning issue (#1203). I don't think that's going to be any time soon, so let's close this one. |
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.
This PR is my attempt to separate the current bindings generators into their own crates (but still in the UniFFI repo).
Let's not merge this one until we figure out the issue of versioning mismatches between the bindings and scaffolding code (#1203). Having separate bindings crates will probably just make that worse.
The main reason I'm sharing this code is that I want to merge the very first commit which adds a testing framework for this. That's going to be very useful for the desktop JS bindings. The other commits can hopefully serve as a example of how that framework would be used.
For each language, I:
uniffi_bindgen/src/bindings/[lang]/
touniffi_bindgen_[lang]/src/
uniffi_bindgen_[lang]/src/lib.rs
that creates the CLI by leveraging theBindingGenerator
traituniffi_bindgen_[lang]/src/gen_[lang]/mod.rs
. Removed the old code and added aBindingGeneratorConfig
impl.uniffi_bindgen_[lang]/src/mod.rs
and put it intouniffi_bindgen_[lang]/tests/fixtures.rs
, then deleted the mod.rs file