-
Notifications
You must be signed in to change notification settings - Fork 18
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
Bundle all headers and swift files for multi-crate UniFFI setups #54
Bundle all headers and swift files for multi-crate UniFFI setups #54
Conversation
Due to #53 being merged, the code for accessing the Swift config should be altered slightly. I think this is how we can do it: for output in uniffi_outputs {
let config = output.bindings.swift;
let file_name = config.module_name();
fs::copy(
out_dir.join(format!("{file_name}.swift")),
sources.join(format!("{file_name}.swift")),
)?;
fs::copy(
out_dir.join(config.header_filename()),
headers.join(config.header_filename()),
)?;
fs::copy(
out_dir.join(config.modulemap_filename()),
headers.join(config.modulemap_filename()),
)?;
} Please update the code in bindings.rs accordingly for this PR to be merged. Thank you for your contribution! :) |
Unfortunately the I guess we could just continue to use the old approach for generating the filenames, just with all the different crate names. |
Ah, you are right. That was an oversight on my side. Thanks providing an alternative solution! |
Thank you so much for creating an end-to-end test project for this feature as well. Great contribution! |
In workspaces where UniFFI types are declared in multiple separate crates, UniFFI bindgen generates a set of Swift files, headers and a header map for each Rust crate that declares UniFFI types.
Currently, only the files corresponding to the main crate (from where
cargo swift
was called) are added. This PR copies all the files to the resulting xcode project.