diff --git a/Cargo.lock b/Cargo.lock index e5375c6..85b2dee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -240,6 +240,18 @@ dependencies = [ "clap_lex", ] +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.74", +] + [[package]] name = "clap_lex" version = "0.7.2" @@ -286,9 +298,10 @@ dependencies = [ [[package]] name = "cooklang-bindings" -version = "0.0.2" +version = "0.13.3" dependencies = [ "anyhow", + "clap_derive", "cooklang", "uniffi", ] @@ -1348,21 +1361,22 @@ checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "uniffi" -version = "0.28.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db87def739fe4183947f8419d572d1849a4a09355eba4e988a2105cfd0ac6a7" dependencies = [ "anyhow", "cargo_metadata", "uniffi_bindgen", - "uniffi_build", "uniffi_core", "uniffi_macros", ] [[package]] name = "uniffi_bindgen" -version = "0.28.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a112599c9556d1581e4a3d72019a74c2c3e122cc27f4af12577a429c4d5e614" dependencies = [ "anyhow", "askama", @@ -1378,24 +1392,14 @@ dependencies = [ "textwrap", "toml 0.5.11", "uniffi_meta", - "uniffi_testing", "uniffi_udl", ] -[[package]] -name = "uniffi_build" -version = "0.28.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" -dependencies = [ - "anyhow", - "camino", - "uniffi_bindgen", -] - [[package]] name = "uniffi_checksum_derive" -version = "0.28.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22dbe67c1c957ac6e7611bdf605a6218aa86b0eebeb8be58b70ae85ad7d73dc" dependencies = [ "quote", "syn 2.0.74", @@ -1403,8 +1407,9 @@ dependencies = [ [[package]] name = "uniffi_core" -version = "0.28.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c35aaad30e3a9e6d4fe34e358d64dbc92ee09045b48591b05fc9f12e0905b" dependencies = [ "anyhow", "bytes", @@ -1417,8 +1422,9 @@ dependencies = [ [[package]] name = "uniffi_macros" -version = "0.28.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db66474c5c61b0f7afc3b4995fecf9b72b340daa5ca0ef3da7778d75eb5482ea" dependencies = [ "bincode", "camino", @@ -1434,8 +1440,9 @@ dependencies = [ [[package]] name = "uniffi_meta" -version = "0.28.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d898893f102e0e39b8bcb7e3d2188f4156ba280db32db9e8af1f122d057e9526" dependencies = [ "anyhow", "bytes", @@ -1445,8 +1452,9 @@ dependencies = [ [[package]] name = "uniffi_testing" -version = "0.28.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6aa4f0cf9d12172d84fc00a35a6c1f3522b526daad05ae739f709f6941b9b6" dependencies = [ "anyhow", "camino", @@ -1457,8 +1465,9 @@ dependencies = [ [[package]] name = "uniffi_udl" -version = "0.28.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b044e9c519e0bb51e516ab6f6d8f4f4dcf900ce30d5ad07c03f924e2824f28e" dependencies = [ "anyhow", "textwrap", @@ -1574,7 +1583,8 @@ dependencies = [ [[package]] name = "weedle2" version = "5.0.0" -source = "git+https://github.com/mozilla/uniffi-rs?branch=main#a99d26e3d8e73e45a7b4a6c35a82fdbba77e728d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e" dependencies = [ "nom", ] diff --git a/Cargo.toml b/Cargo.toml index 25fc809..39ae741 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,3 +55,6 @@ harness = false [workspace] members = [".", "playground", "bindings", "fuzz"] + +[profile.release] +strip = true diff --git a/bindings/Cargo.toml b/bindings/Cargo.toml index 1f2035e..b3f8754 100644 --- a/bindings/Cargo.toml +++ b/bindings/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cooklang-bindings" -version = "0.0.2" +version = "0.13.3" edition = "2021" authors = ["dubadub "] description = "Cooklang Uniffi bindings" @@ -12,18 +12,12 @@ readme = "README.md" [dependencies] anyhow = "1.0" cooklang = { path = ".." } -uniffi = { git = "https://github.com/mozilla/uniffi-rs", branch = "main" } - -[dev-dependencies] -uniffi = { git = "https://github.com/mozilla/uniffi-rs", features = ["bindgen-tests"], branch = "main" } - -[build-dependencies] -uniffi = { git = "https://github.com/mozilla/uniffi-rs", features= ["build"], branch = "main" } +uniffi = "0.28.1" +clap_derive = { version = "4.0.0-rc.1" } [lib] crate-type = ["cdylib", "staticlib"] - [[bin]] # workaround: https://mozilla.github.io/uniffi-rs/tutorial/foreign_language_bindings.html#creating-the-bindgen-binary # This can be whatever name makes sense for your project, but the rest of this tutorial assumes uniffi-bindgen. diff --git a/bindings/uniffi.toml b/bindings/uniffi.toml new file mode 100644 index 0000000..9f1c47d --- /dev/null +++ b/bindings/uniffi.toml @@ -0,0 +1,9 @@ +[bindings.kotlin] +package_name = "org.cooklang.parser" +generate_immutable_records = true +android = true + +[bindings.swift] +ffi_module_name = "CooklangParserFFI" +module_name = "CooklangParser" +generate_immutable_records = true