carol/soma-parser
Sign in
main
soma-parser/Cargo.toml
61 lines · 2.1 KBRaw
1[package]
2name = "soma_chat_history_parser"
3version = "0.1.0"
4edition = "2024"
5description = "Rust port of the Soma ChatImport pipeline: platform chat export -> schema-conformant chat_history.zip"
6license = "MIT"
7
8[lib]
9name = "soma_chat_history_parser"
10path = "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`.
13crate-type = ["lib", "staticlib", "cdylib"]
14
15[[bin]]
16name = "soma-chat-parser"
17path = "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]]
27name = "uniffi-bindgen"
28path = "src/bin/uniffi-bindgen.rs"
29required-features = ["bindgen"]
30
31[features]
32default = []
33# Enables the in-tree `uniffi-bindgen` binary (regenerate Swift/Kotlin bindings).
34bindgen = ["uniffi/cli"]
35
36[dependencies]
37regex = "1"
38fancy-regex = "0.16"
39serde = { version = "1", features = ["derive"] }
40serde_json = "1"
41chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
42zip = { version = "2", default-features = false, features = ["deflate"] }
43pdfium-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.
48uniffi = "0.32"
49
50[dev-dependencies]
51tempfile = "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]
56opt-level = "z"
57lto = false
58codegen-units = 1
59panic = "abort"
60strip = "debuginfo"
61