Skip to content
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

Generate immutable records in uniffi bindings #332

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ codegen-units = 1
# This is fine as long as we don't have any unhandled panics, but let's keep it disabled for now
# strip = true

# Using master until 0.25.1 is released to fix https://github.com/mozilla/uniffi-rs/issues/1798
# Using git dependency temporarily to add support for immutable records in generated code
[patch.crates-io]
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "b369e7c15b1b7ebca34de9028209db11b7ff353d" }
uniffi_build = { git = "https://github.com/mozilla/uniffi-rs", rev = "b369e7c15b1b7ebca34de9028209db11b7ff353d" }
uniffi_bindgen = { git = "https://github.com/mozilla/uniffi-rs", rev = "b369e7c15b1b7ebca34de9028209db11b7ff353d" }
uniffi_core = { git = "https://github.com/mozilla/uniffi-rs", rev = "b369e7c15b1b7ebca34de9028209db11b7ff353d" }
uniffi_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "b369e7c15b1b7ebca34de9028209db11b7ff353d" }
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
uniffi_build = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
uniffi_bindgen = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
uniffi_core = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
uniffi_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
4 changes: 2 additions & 2 deletions crates/bitwarden-uniffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ chrono = { version = ">=0.4.26, <0.5", features = [
"std",
], default-features = false }
env_logger = "0.10.0"
uniffi = "=0.25.0"
uniffi = "=0.25.1"
schemars = { version = ">=0.8, <0.9", optional = true }

bitwarden = { path = "../bitwarden", features = ["mobile", "internal"] }

[build-dependencies]
uniffi = { version = "=0.25.0", features = ["build"] }
uniffi = { version = "=0.25.1", features = ["build"] }

[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies]
openssl = { version = "0.10", features = ["vendored"] }
2 changes: 2 additions & 0 deletions crates/bitwarden-uniffi/uniffi.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[bindings.kotlin]
package_name = "com.bitwarden.sdk"
cdylib_name = "bitwarden_uniffi"
generate_immutable_records = true

[bindings.swift]
ffi_module_name = "BitwardenFFI"
module_name = "BitwardenSDK"
generate_immutable_records = true
2 changes: 1 addition & 1 deletion crates/bitwarden/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ chrono = { version = ">=0.4.26, <0.5", features = [
"serde",
"std",
], default-features = false }
uniffi = { version = "=0.25.0", optional = true }
uniffi = { version = "=0.25.1", optional = true }

# We don't use this directly (it's used by rand), but we need it here to enable WASM support
getrandom = { version = ">=0.2.9", features = ["js"] }
Expand Down
2 changes: 2 additions & 0 deletions crates/bitwarden/uniffi.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[bindings.kotlin]
package_name = "com.bitwarden.core"
generate_immutable_records = true

[bindings.swift]
ffi_module_name = "BitwardenCoreFFI"
module_name = "BitwardenCore"
generate_immutable_records = true
2 changes: 1 addition & 1 deletion crates/uniffi-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"

[dependencies]
uniffi = { version = "=0.25.0", features = ["cli"] }
uniffi = { version = "=0.25.1", features = ["cli"] }