main
61 lines · 2.1 KBRaw
| 1 | [package] |
| 2 | name = "soma_chat_history_parser" |
| 3 | version = "0.1.0" |
| 4 | edition = "2024" |
| 5 | description = "Rust port of the Soma ChatImport pipeline: platform chat export -> schema-conformant chat_history.zip" |
| 6 | license = "MIT" |
| 7 | |
| 8 | [lib] |
| 9 | name = "soma_chat_history_parser" |
| 10 | path = "src/lib.rs" |
| 11 | # `lib` for the rlib (tests / CLI), `staticlib` for the iOS `.a` -> .xcframework, |
| 12 | # `cdylib` for the Android `.so` + host library used by `uniffi-bindgen`. |
| 13 | crate-type = ["lib", "staticlib", "cdylib"] |
| 14 | |
| 15 | [[bin]] |
| 16 | name = "soma-chat-parser" |
| 17 | path = "src/main.rs" |
| 18 | |
| 19 | # In-tree `uniffi-bindgen` binary. UniFFI 0.32 ships the bindgen CLI behind the |
| 20 | # `uniffi/cli` feature (the standalone `uniffi-bindgen` crate is not separately |
| 21 | # published); gating it behind our own `bindgen` feature keeps the mobile |
| 22 | # staticlib free of CLI-only deps. Run with: |
| 23 | # cargo run --features bindgen --bin uniffi-bindgen -- \ |
| 24 | # generate --library target/debug/libsoma_chat_history_parser.dylib \ |
| 25 | # --language swift --out-dir <dir> |
| 26 | [[bin]] |
| 27 | name = "uniffi-bindgen" |
| 28 | path = "src/bin/uniffi-bindgen.rs" |
| 29 | required-features = ["bindgen"] |
| 30 | |
| 31 | [features] |
| 32 | default = [] |
| 33 | # Enables the in-tree `uniffi-bindgen` binary (regenerate Swift/Kotlin bindings). |
| 34 | bindgen = ["uniffi/cli"] |
| 35 | |
| 36 | [dependencies] |
| 37 | regex = "1" |
| 38 | fancy-regex = "0.16" |
| 39 | serde = { version = "1", features = ["derive"] } |
| 40 | serde_json = "1" |
| 41 | chrono = { version = "0.4", default-features = false, features = ["clock", "std"] } |
| 42 | zip = { version = "2", default-features = false, features = ["deflate"] } |
| 43 | pdfium-render = { version = "0.8", default-features = false, features = ["sync", "pdfium_latest"] } |
| 44 | # UniFFI proc-macros (default features) wire the FFI scaffolding compiled into |
| 45 | # the static/dynamic libs. The bindgen binary lives in the separate |
| 46 | # `uniffi-bindgen` crate (installed in CI); no `cli`/`bindgen` feature needed |
| 47 | # here, which keeps the mobile staticlib free of bindgen-only deps. |
| 48 | uniffi = "0.32" |
| 49 | |
| 50 | [dev-dependencies] |
| 51 | tempfile = "3" |
| 52 | |
| 53 | # Mobile artifacts are shipped inside the app, so optimize release builds for |
| 54 | # size and let LLVM eliminate parser code that is unreachable across crates. |
| 55 | [profile.release] |
| 56 | opt-level = "z" |
| 57 | lto = false |
| 58 | codegen-units = 1 |
| 59 | panic = "abort" |
| 60 | strip = "debuginfo" |
| 61 |