Skip to content

Commit

Permalink
Adjust for default binding generator
Browse files Browse the repository at this point in the history
  • Loading branch information
KingOfDog committed Apr 5, 2024
1 parent 4fcba12 commit 093bccb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@ pub fn generate_bindings(lib_path: &Utf8Path) -> Result<()> {
)?;

for output in uniffi_outputs {
let file_name = output.config.module_name();
let crate_name = output.crate_name;
fs::copy(
out_dir.join(format!("{file_name}.swift")),
sources.join(format!("{file_name}.swift")),
out_dir.join(format!("{crate_name}.swift")),
sources.join(format!("{crate_name}.swift")),
)?;

let ffi_name = format!("{crate_name}FFI");
fs::copy(
out_dir.join(output.config.header_filename()),
headers.join(output.config.header_filename()),
out_dir.join(format!("{ffi_name}.h")),
headers.join(format!("{ffi_name}.h")),
)?;
fs::copy(
out_dir.join(output.config.modulemap_filename()),
headers.join(output.config.modulemap_filename()),
out_dir.join(format!("{ffi_name}.modulemap")),
headers.join(format!("{ffi_name}.modulemap")),
)?;
}

Expand Down

0 comments on commit 093bccb

Please sign in to comment.