Skip to content

Commit 42d4db1

Browse files
committed
Add wp_mobile crate that depends on wp_api
1 parent 8f087fe commit 42d4db1

File tree

6 files changed

+50
-1
lines changed

6 files changed

+50
-1
lines changed

Cargo.lock

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ members = [
1212
"wp_localization_macro",
1313
"wp_localization_parser",
1414
"wp_localization_validation",
15+
"wp_mobile",
1516
"wp_rs_cli",
1617
"wp_rs_web",
1718
"wp_serde_helper",

wp_api/uniffi.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[bindings.kotlin]
22
android = false
33
android_cleaner = false
4-
cdylib_name = "wp_api"
4+
cdylib_name = "wp_mobile"
55
generate_immutable_records = true
66

77
[bindings.kotlin.custom_types.WpGmtDateTime]

wp_mobile/Cargo.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[package]
2+
name = "wp_mobile"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[features]
7+
reqwest-request-executor = ["wp_api/reqwest-request-executor"]
8+
9+
[lib]
10+
crate-type = ["lib", "cdylib", "staticlib"]
11+
name = "wp_mobile"
12+
13+
[dependencies]
14+
uniffi = { workspace = true }
15+
wp_api = { path = "../wp_api" }
16+
17+
[build-dependencies]
18+
uniffi = { workspace = true , features = [ "build", "cli" ] }

wp_mobile/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Re-export wp_api to ensure its bindings are generated
2+
pub use wp_api;
3+
4+
#[uniffi::export]
5+
fn wp_mobile_crate_works(foo: String) -> String {
6+
format!("foo is {}", foo)
7+
}
8+
9+
uniffi::setup_scaffolding!();

wp_mobile/uniffi.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[bindings.kotlin]
2+
android = false
3+
android_cleaner = false
4+
cdylib_name = "wp_mobile"
5+
generate_immutable_records = true
6+
7+
[bindings.swift]
8+
ffi_module_name = "libwordpressFFI"
9+
ffi_module_filename = "wp_mobile_uniffi"
10+
generate_module_map = false
11+
generate_immutable_records = true
12+
experimental_sendable_value_types = true
13+
omit_localized_error_conformance = true

0 commit comments

Comments
 (0)